InterBase: What Sets It Apart - by Borland Developer Support Staff InterBase:¹«¾ùÀÌ Borland °³¹ßÀÚ Áö¿ø ½ºÅÂÇÁ¿¡ ÀÇÇÏ¿© ±×°ÍÀ» ¶¼¾î µÐ´Ù. Abstract:The most significant difference between InterBase and other database servers is its multi-generational architecture. InterBase¿Í ´Ù¸¥ µ¥ÀÌÅͺ£À̽º ¼­¹ö »çÀÌÀÇ Abstract:The °¡Àå Áß¿äÇÑ Â÷ÀÌ´Â °ÇÃà ±×°ÍÀÇ generational ¸ÖƼÀÌ´Ù. As you rush headlong into the world of Client/Server computing one of the first things you have to do is select a database server. The architectures of database servers vary widely and as a result their behavior in a given situation also varies widely. That means that to select the right server for your application you must understand two things. ´ç½ÅÀÌ ²¨²Ù·Î ¼º±ÞÇÏ°Ô ´ç½ÅÀÌ ÇØ¾ß ÇÏ´Â ¸Ç ¸ÕÀú ÁßÀÇ Çϳª°¡ ÀÖ´Â °ÍÀ» »êÃâÇϰí ÀÖ´Â °í°´/¼­¹öÀÇ ¼¼°è¸¦ ÇÒ ¶§ µ¥ÀÌÅͺ£À̽º ¼­¹ö¸¦ ¼±ÅÃÇØ¶ó.µ¥ÀÌÅͺ£À̽º ¼­¹öÀÇ °ÇÃàÀÌ ³Î¸® ´Þ¶ó Áö°í ±× °á°ú ¶ÇÇÑ ÁÖ¾îÁø »óȲÀÇ ±×µéÀÇ ÇൿÀº ³Î¸® ´Þ¶ó Áø´Ù.±×°ÍÀº ´ç½ÅÀÇ ÀÀ¿ëÀ» À§ÇÑ ¿ÇÀº ¼­¹ö¸¦ ¼±ÅÃÇϱâ À§ÇØ ´ç½ÅÀÌ 2 ÀÏÀ» ÀÌÇØÇØ¾ß ÇÏ´Â °ÍÀ» ÀǹÌÇÑ´Ù. How data will be accessed and modified in your application. ¾î¶»°Ô Á¢±ÙÇÒ °ÍÀÌ°í µ¥ÀÌÅͰ¡ ´ç½ÅÀÇ ÀÀ¿ë¿¡(¼­)ºÎºÐ ¼öÁ¤µÉ °ÍÀÌ´Ù. How the server will behave in each data access or update situation. ¾î¶»°Ô ¼­¹ö´Â °¢ µ¥ÀÌÅÍ ¾×¼¼½º³ª ¾÷µ¥ÀÌÆ® »óȲ¿¡(¼­)ÇൿÇÒ °ÍÀÌ´Ù. The most significant difference between Interbase and other database servers is its multi-generational architecture. Multi-generational architecture is also called versioning architecture and to understand how it is different you need to explore the different methods of controlling concurrent access to data by many users. Interbase¿Í ´Ù¸¥ µ¥ÀÌÅͺ£À̽º ¼­¹ö »çÀÌÀÇ °¡Àå Áß¿äÇÑ Â÷ÀÌ´Â °ÇÃà ±×°ÍÀÇ generational ¸ÖƼÀÌ´Ù.¸ÖƼ generational °ÇÃàÀÌ ¶ÇÇÑ ºÒ¸®¿î versioning °ÇÃàÀÌ°í ¾î¶»°Ô ±×°ÍÀÌ ´Ù¸£´Ù´Â °ÍÀ» ¾Ë±â À§ÇØ ´ç½ÅÀº ¸¹Àº »ç¿ëÀÚ¿¡ ÀÇÇÏ¿© µ¥ÀÌÅÍ¿¡ÀÇ µ¿½Ã ¾×¼¼½º¸¦ ÄÁÆ®·ÑÇÏ´Â ´Ù¸¥ ¹æ¹ýÀ» Á¶»çÇØ¾ß ÇÑ´Ù. Locking Schemes °èȹÀ» Àá±×±â The oldest and most common method of controlling concurrent access to data by several users is locking. When one user locks an object in a database he or she restricts the ability of other users to access that object. How much a lock affects concurrency depends on the granularity of the lock. For example, a lock placed on an entire table will restrict other users access to all of the rows in the table. Therefore, a table level lock has very low granularity. A lock placed on a single page in a table limits access to all of the rows on that page. A page level lock is more granular than a table level lock. By contrast, a lock placed on a single row is very granular and provides the minimum restriction to concurrent data access. ¿©·¯ »ç¿ëÀÚ¿¡ ÀÇÇÏ¿© µ¥ÀÌÅÍ¿¡ÀÇ µ¿½Ã ¾×¼¼½º¸¦ ÄÁÆ®·ÑÇÏ´Â °¡Àå ¿À·¡µÇ°í °¡Àå °øÅëÀûÀÎ ¹æ¹ýÀº Àá±â°í ÀÖ´Ù.Çϳª »ç¿ëÀÚ°¡ ¹°°ÇÀ» µ¥ÀÌÅͺ£À̽º¿¡ ³Ö°í Àá±Û ¶§ ±×³ª ±×³à´Â ±× ¹°°Ç¿¡ Á¢±ÙÇÒ ´Ù¸¥ »ç¿ëÀÚÀÇ ´É·ÂÀ» Á¦ÇÑÇÑ´Ù.¾ó¸¶ ÀÚ¹°¼è º´Ç༺ °¨Á¤Àº ÀÚ¹°¼èÀÇ ¾Ë°»ÀÌ ¸ð¾ç¿¡ ÀÇÁ¸ÇÑ´Ù.¿¹¸¦ µé¸é Àüü Å×ÀÌºí¿¡ µÖ Áø ÀÚ¹°¼è°¡ »ç¿ëÀÚ Å×À̺íÀÇ ¸ðµç ÁÙ¿¡ÀÇ ´Ù¸¥ ¾×¼¼½º¸¦ Á¦ÇÑÇÒ °ÍÀÌ´Ù.µû¶ó¼­ Å×ÀÌºí ±ÕÀÏÇÑ ÀÚ¹°¼è´Â ¸Å¿ì ³·Àº ¾Ë°»ÀÌ ¸ð¾çÀ» °¡Áö°í ÀÖ´Ù.Å×ÀÌºí¿¡(¼­)´ÜÇϳªÀÇ ÆäÀÌÁö¿¡ µÖ Áø ÀÚ¹°¼è°¡ ±× ÆäÀÌÁö À§ÀÇ ¸ðµç ÁÙ¿¡ ´ëÇÑ ¾×¼¼½º¸¦ Á¦ÇÑÇÑ´Ù.ÆäÀÌÁö ±ÕÀÏÇÑ ÀÚ¹°¼è´Â Å×À̺íÀÌ ÀÚ¹°¼è¸¦ °í¸£°Ô ÇÏ´Â °Íº¸´Ù ´õ ¾Ë°»ÀÌ ¸ð¾çÀÇ´Ù.´ëÁ¶ÀûÀ¸·Î ´ÜÇϳªÀÇ ÁÙ¿¡ µÖ Áø ÀÚ¹°¼è°¡ ¸Å¿ì ¾Ë°»ÀÌ ¸ð¾çÀÇ°í µ¿½Ã µ¥ÀÌÅÍ ¾×¼¼½º¿¡(°Ô)¿¡ ÃÖ¼Ò Á¦ÇÑÀ» Á¦°øÇÑ´Ù. Database servers support either row or page level locking. The problem with page level locks is easy to see if you consider an example. Suppose the size of a page is 2k (2048 bytes) and the size of a row is 100 bytes. Then each page can hold 20 rows and each time a page is locked access is restricted to all 20 rows. With row level locking only a single row would be locked and other users would be free to access other records on the page so row level locking provides better concurrency. µ¥ÀÌÅͺ£À̽º ¼­¹ö´Â Àá±â¸é¼­ ¶ÇÇÑ ÁÙÀ̳ª ÆäÀÌÁö ·¹º§À» ÁöÁöÇÑ´Ù.ÆäÀÌÁö ·¹º§À» °¡Áö°í ¹®Á¦ ÀÚ¹°¼è´Â ¸¸¾à ´ç½ÅÀÌ ¿¹¸¦ °í·ÁÇÑ´Ù¸é º¸±â¿¡ ½±´Ù.ÆäÀÌÁöÀÇ »çÀÌÁî°¡ 2k(¹ÙÀÌÆ® 2048 Æí)À̰í ÁÙÀÇ »çÀÌÁî°¡ ¹ÙÀÌÆ® 100 ÆíÀ̶ó°í °¡Á¤Çضó.±×¶§ °¢ ÆäÀÌÁö°¡ 20 ÁÙÀ» ÀâÀ» ¼ö ÀÖ°í ÆäÀÌÁö°¡ Àá±æ ¶§¸¶´Ù ¾×¼¼½º´Â ¸ðµç 20 ÁÙ¿¡(°Ô)Á¦ÇѵȴÙ.ÁÙ ·¹º§À» °¡Áö°í ´ÜÇϳªÀÇ ÁÙ¸¸À» Àá±×´Â °ÍÀÌ Àá°Ü Áú °ÍÀÌ°í ´Ù¸¥ »ç¿ëÀÚ´Â ÀÚÀ¯·Ó°Ô ÆäÀÌÁö À§ÀÇ ´Ù¸¥ ±â·Ï¿¡ Á¢±ÙÇÒ ¼ö ÀÖÀ» °ÍÀÌ´Ù ±×·¡¼­ ÁÙ Àá±â°í ÀÖ´Â ·¹º§ÀÌ ´õ ÁÁÀº º´Ç༺À» Á¦°øÇÑ´Ù. If you come from a desktop database background you are probably most familiar with a scheme called pessimistic locking. Pessimistic locking is so named because it assumes that the probability is high that another user will try to modify the same object in the database that you are changing. In a pessimistic locking environment the object you wish to change is locked before you begin changing it and remains locked until you commit your change. The advantage of pessimistic locking is that you are guaranteed that you will be able to post the changed row. ¸¸¾à ´ç½ÅÀÌ µ¥½ºÅ©Å¾ µ¥ÀÌÅͺ£À̽º ¹é±×¶ó¿îµå¿¡¼­ ¿Â´Ù¸é ´ç½ÅÀº ¾Æ¸¶ ºñ°üÀûÀÎ °ÍÀ̶ó°í ºÒ¸®´Â Àá±â°í ÀÖ´Â °èȹÀ» °¡Àå Àß ¾Ë°í ÀÖÀÏ °ÍÀÌ´Ù.±×°ÍÀÌ °³¿¬¼ºÀÌ ´Ù¸¥ »ç¿ëÀÚ°¡ ³ôÀÌ ±×°ÍÀ» ½ÃµµÇÒ °Í ¶È°°Àº ¹°°ÇÀ» ºÎºÐ ¼öÁ¤Çϱâ À§ÇØ ´ç½ÅÀÌ ¹Ù²Ù°í ÀÖ´Â µ¥ÀÌÅͺ£À̽º¿¡ ÀÖ´Ù°í »ý°¢Çϱ⠶§¹®¿¡ ºñ°üÀûÀÌ°Ô Àá±â´Â °ÍÀÌ ±×·¸°ÔÀ̶ó°í ¸í¸íµÈ´Ù.´ç½ÅÀÌ ±×°ÍÀ» ¹Ù²Ù±â ½ÃÀÛÇÏ°í ´ç½ÅÀÌ ´ç½ÅÀÇ Ã¼ÀÎÁö¸¦ ¹üÇÒ ¶§±îÁö ³²¾Æ ÀÖ´Â °ÍÀÌ Àá±â±â Àü¿¡ ºñ°üÀûÀÎ Àá±â°í Àִ ȯ°æ¿¡(¼­)´ç½ÅÀÌ ¹Ù²Ù°í ½ÍÀº ¹°°ÇÀÌ Àá±ä´Ù.ºñ°üÀûÀÌ°Ô Àá±â´Â ÀÌÁ¡Àº ´ç½Å¿¡°Ô ´ç½ÅÀÌ ¹Ù²ï ÁÙÀ» ¾Ë¸± ¼ö ÀÖÀ» °ÍÀ» º¸ÁõÇÏ´Â °ÍÀÌ´Ù. Suppose you need to change a customer¡¯s address. Using pessimistic locking you would first lock the customer information at either the page or row level. You can then read the customer¡¯s record, change it and be guaranteed that you can write your changes to the database. Once you commit your changes your lock is released and others are free to change the customer¡¯s record. Locks can persist for a long time when pessimistic locking is used. You could begin a change then go to lunch and not commit the change and release the lock until you return. Clearly you want to use locks with high granularity if you are going to use pessimistic locking in a multi-user environment. If you must lock an entire page of customer records while you are changing a single row no other user will be able to change any other customer record on that page. Row level locks are best when pessimistic locking is used because they impose the least restriction on access by other users. Page level locks are much less satisfactory because they restrict access to many rows as long as they persist. ´ç½ÅÀÌ °í°´ÀÇ ÁÖ¼Ò¸¦ ¹Ù²Ù¾î¾ß ÇÑ´Ù°í °¡Á¤Çضó.óÀ½À¸·Î ºñ°üÀûÀÌ°Ô ´ç½ÅÀ» Àá±×´Â °ÍÀÌ ¶ÇÇÑ ÆäÀÌÁö³ª ÁÙ ·¹º§¿¡(¼­)°í°´ Á¤º¸¸¦ Àá±Û °ÍÀÎ »ç¿ëÇϱâ.±×¶§ ´ç½ÅÀÌ °í°´ÀÇ ±â·ÏÀ» ÀÐÀ» ¼ö ÀÖ´Ù.±×°ÍÀ» ¹Ù²Ü ¼ö ÀÖ´Ù.´ç½ÅÀÌ µ¥ÀÌÅͺ£À̽º¿¡ ´ëÇÑ ´ç½ÅÀÇ Ã¼ÀÎÁö¸¦ ¾µ ¼ö ÀÖ´Ù°í º¸ÀåÇØ Áú ¼ö ÀÖ´Ù.ÀÏ´Ü ´ç½ÅÀÌ ´ç½ÅÀÇ Ã¼ÀÎÁö¸¦ ¹üÇÏ¸é ´ç½ÅÀÇ ÀÚ¹°¼è°¡ ¹ßÇ¥µÇ°í ´Ù¸¥ »ç¶÷Àº ÀÚÀ¯·Ó°Ô °í°´ÀÇ ±â·ÏÀ» ¹Ù²Ü ¼ö ÀÖ´Ù.ºñ°üÀûÀÌ°Ô Àá±â´Â °ÍÀÌ »ç¿ëµÉ ¶§ ÀÚ¹°¼è´Â ¿À·§µ¿¾È °è¼ÓµÉ ¼ö ÀÖ´Ù.´ç½ÅÀº ´ç½ÅÀÌ µ¹¾Æ¿À´Â ±×¶§°¡ Á¡½ÉÀ» ¸Ô°í üÀÎÁö¸¦ ¹üÇÏÁö ¾Ê°í ÀÚ¹°¼è¸¦ ¹ßÇ¥ÇÏÁö ¾ÊÀ¸·¯ °¡´Â üÀÎÁö¸¦ ½ÃÀÛÇÒ ¼ö ÀÖ¾ú´Ù.¸¸¾à ´ç½ÅÀÌ »ç¿ë ºñ°üÀûÀÌ°Ô multi-user ȯ°æÀ» Àá±×´Â °Í¿¡ °¡°í ÀÖ´Â´Ù¸é ¸íÈ®ÇÏ°Ô ´ç½ÅÀº ³ôÀº ¾Ë°»ÀÌ ¸ð¾çÀ» °¡Áö°í ÀÚ¹°¼è¸¦ »ç¿ëÇÏ°í ½Í´Ù.¸¸¾à ´ç½ÅÀÌ ´ÜÇϳªÀÇ ÁÙÀ» ¹Ù²Ù°í ÀÖ´Â µ¿¾È ´ç½ÅÀÌ °í°´ ±â·ÏÀÇ Àüü ÆäÀÌÁö¸¦ Àá°¡¾ß ÇÑ´Ù¸é ´Ù¸¥ »ç¿ëÀÚ´Â ±× ÆäÀÌÁö À§ÀÇ ´Ù¸¥ ¾î¶² °í°´ ±â·ÏÀ» ¹Ù²Ü ¼ö ÀÖÀ» °ÍÀÌ ¾Æ´Ï´Ù.±×µéÀÌ ÃÖ¼Ò ¾×¼¼½º¿¡ Á¦¾àÀ» °¡Çϱ⠶§¹®¿¡ ºñ°üÀûÀÌ°Ô Àá±â´Â °ÍÀÌ ´Ù¸¥ »ç¿ëÀÚ¿¡ ÀÇÇÏ¿© »ç¿ëµÉ ¶§ ±ÕÀÏÇÑ ÀÚ¹°¼è°¡ °¡Àå ÁÁ ¹è¸¦ Àú¾î¶ó.±×µéÀÌ °è¼ÓµÈ ÇÑ ±×µéÀÌ ¸¹Àº ÁÙ¿¡ ´ëÇÑ ¾×¼¼½º¸¦ Á¦ÇÑÇϱ⠶§¹®¿¡ Page ±ÕÀÏÇÑ ÀÚ¹°¼è´Â much less ¸¸Á·½º·´´Ù. The most common locking scheme found in database servers is optimistic locking. The locking mechanism is optimistic in that it assumes that it is very unlikely that another user will try to change the same row that you are changing. An optimistic lock is not placed until you try to commit your changes. To understand optimistic locking consider two users, John and Jane, trying to change a customer¡¯s record. First John reads the record and begins to make changes. Next Jane reads the record and begins to make changes. This is possible because in the optimistic locking scheme no lock is placed when a user reads a record and begins changing it. Next John completes his changes and attempts to commit them. At this point the database locks the record, commits the change and releases the lock. When Jane tries to commit her change the software detects that the record has been changed since Jane read it and her change is rejected. Jane must now re-read the record and begin again. °¡Àå °øÅëÀûÀÌ°Ô µ¥ÀÌÅͺ£À̽º ¼­¹ö¿¡¼­ ¹ß°ßÇØ Áø °èȹÀ» Àá±×´Â °ÍÀº Àá±â¸é¼­ ³«ÃµÀûÀÌ´Ù.Àá±â°í ÀÖ´Â ÀåÄ¡´Â ±×°Í¿¡(¼­)±×°ÍÀÌ ±×°ÍÀÌ ´Ù¸¥ »ç¿ëÀÚ°¡ ´ç½ÅÀÌ ¹Ù²Ù°í ÀÖ´Â ¶È°°Àº ÁÙÀ» ¹Ù²Ù·Á°í ³ë·ÂÇÒ °Í ¸Å¿ì ÀÖÀ» ¹ýÇÏÁö ¾Ê´Â´Ù°í »ý°¢ÇÏ´Â ³«ÃµÀûÀÌ´Ù.´ç½ÅÀÌ ´ç½ÅÀÇ Ã¼ÀÎÁö¸¦ ¹üÇÏ·Á°í ³ë·ÂÇÒ ¶§±îÁö ³«ÃµÀûÀÎ ÀÚ¹°¼è¸¦ µÎÁö ¾Ê´Â´Ù.°í°´ÀÇ ±â·ÏÀ» ¹Ù²Ù·Á°í ³ë·ÂÇϸ鼭 ³«ÃµÀûÀÌ°Ô Àá±â´Â °ÍÀ» ÀÌÇØÇϱâ À§ÇØ »ç¿ëÀÚ¿Í Á¸°ú Á¦ÀÎ 2 ¸íÀ» °í·ÁÇØ¶ó.ù° Á¸ÀÌ ±â·ÏÀ» ÀÐ°í ¹Ù²Ù±â ½ÃÀÛÇÑ´Ù.´ÙÀ½ Á¦ÀÎÀÌ ±â·ÏÀ» ÀÐ°í ¹Ù²Ù±â ½ÃÀÛÇÑ´Ù.»ç¿ëÀÚ°¡ ±â·ÏÀ» ÀÐ°í ±×°ÍÀ» ¹Ù²Ù±â ½ÃÀÛÇÒ ¶§ ³«ÃµÀûÀÎ Àá±â°í ÀÖ´Â °èȹ¿¡(¼­)ÀÚ¹°¼è¸¦ µÎÁö ¾Ê±â ¶§¹®¿¡ À̰ÍÀº °¡´ÉÇÏ´Ù.´ÙÀ½ Á¸ÀÌ ±×ÀÇ Ã¼ÀÎÁö¸¦ ¿Ï·áÇÏ°í ±×µéÀ» ¹üÇÏ·Á°í ÇÑ´Ù.ÀÌ ½ÃÁ¡¿¡¼­ µ¥ÀÌÅͺ£À̽º°¡ ±â·ÏÀ» Àá±Ù´Ù.üÀÎÁö¸¦ ¹üÇÑ´Ù.ÀÚ¹°¼è¸¦ ¹ßÇ¥ÇÑ´Ù.Á¦ÀÎÀÌ ±×³àÀÇ Ã¼ÀÎÁö¸¦ ¹üÇÏ·Á°í ³ë·ÂÇÒ ¶§ ¼ÒÇÁÆ®¿þ¾î´Â Á¦ÀÎÀÌ ±×°ÍÀ» Àоú°í ±×³àÀÇ Ã¼ÀÎÁö¸¦ °ÅºÎÇÏ´Â ÀÌ·¡·Î ±â·ÏÀÌ ¹Ù²ï °ÍÀ» ŽÁöÇÑ´Ù.Áö±Ý ±â·Ï re-readÀÌ¾ß Çϰí Á¦ÀÎÀº ´Ù½Ã ½ÃÀÛÇØ¾ß ÇÑ´Ù. Optimistic locking has a clear advantage in that locks are only held for a very brief period while the data is actually being updated. That means that with an optimistic locking scheme you can achieve adequate concurrency with less lock granularity. Therefore, databases that use optimistic locking may lock at the page level and not at the row level. On the other hand, optimistic locking does not fare well in an environment where there is a high probability that two users will try to update the same row at the same time. ³«ÃµÀûÀÌ°Ô Àá±â´Â °ÍÀº ½ÇÁ¦·Î µ¥ÀÌÅͰ¡ ¾÷µ¥ÀÌÆ®µÈ µ¿¾È ¸Å¿ì °£·«ÇÑ ½Ã±â µ¿¾È ±×°Í¿¡(¼­)´ÜÁö ÀÚ¹°¼è¸¦ Àâ´Â ¸íÈ®ÇÑ ÀÌÁ¡À» °¡Áö°í ÀÖ´Ù.±×°ÍÀº ³«ÃµÀûÀÎ Àá±â°í ÀÖ´Â °èȹÀ» °¡Áö°í ´ç½ÅÀÌ ´õ ÀûÀº ÀÚ¹°¼è ¾Ë°»ÀÌ ¸ð¾çÀ» °¡Áö°í ¾Ë¸ÂÀº º´Ç༺À» ¾òÀ» ¼ö ÀÖ´Â °ÍÀ» ÀǹÌÇÑ´Ù.µû¶ó¼­ »ç¿ë ³«ÃµÀûÀÌ°Ô Àá±â´Â °ÍÀÌ ÆäÀÌÁö ·¹º§¿¡(¼­),ÁÙ¿¡(¼­)Àá±×Áö ¾ÊÀ» ¼ö ÀÖ´Â µ¥ÀÌÅͺ£À̽º´Â ¼öÆòÀ¸·Î µÈ´Ù.2 »ç¿ëÀÚ°¡ µ¿½Ã¿¡ ¶È°°Àº ÁÙÀ» ¾÷µ¥ÀÌÆ®ÇÏ·Á°í ³ë·ÂÇÏ´Â ³ôÀº °³¿¬¼ºÀÌ ÀÖ´Â °÷¿¡ ´Ù¸¥ ÇÑÆíÀ¸·Î´Â ³«ÃµÀûÀÌ°Ô Àá±â´Â °ÍÀº Àß È¯°æ¿¡(¼­)ÇØ³ª°¡Áö ¾Ê´Â´Ù. From the database vendor¡¯s point of view page level locking is advantageous in that fewer locks must be placed, particularly during batch operations that affect many rows. This means that the resource requirements of the lock manager module in the database management system are lower and this can help performance of the database server. However, users are invariably the slowest part of any database application so you will usually get better overall performance in an environment where one user cannot block another. ºä ÆäÀÌÁö ·¹º§ÀÇ µ¥ÀÌÅͺ£À̽º ÆÇ¸ÅÀÚÀÇ Æ÷ÀÎÆ®·ÎºÎÅÍ Àá±â´Â °ÍÀº ƯÈ÷ ¸¹Àº ÁÙ¿¡ ¿µÇâÀ» ¹ÌÄ¡´Â ¹­À½ ÀÛµ¿ µ¿¾È ³õ¿©¾ß ±×·¸°Ô ´õ ÀûÀº ÀÚ¹°¼è¿¡(¼­)À¯ÀÍÇÏ´Ù.À̰ÍÀÌ µ¥ÀÌÅͺ£À̽º °æ¿µ ½Ã½ºÅÛÀÇ ÀÚ¹°¼è ¸Å´ÏÀú ¸ðµâÀÇ ¸®¼Ò½º ¿ä°ÇÀÌ ´õ ³·Àº °ÍÀ» ÀǹÌÇϰí À̰ÍÀº µ¥ÀÌÅͺ£À̽º ¼­¹öÀÇ ÆÛÆ÷¸Õ½º¸¦ µµ¿ï ¼ö ÀÖ´Ù.±×·¯³ª »ç¿ëÀÚ´Â º¯È­ÇÏÁö ¾Ê°í ¸ðµç µ¥ÀÌÅͺ£À̽º ÀÀ¿ëÀÇ °¡Àå ´À¸° ºÎºÐÀÌ´Ù ±×·¡¼­ Çϳª »ç¿ëÀÚ°¡ ´Ù¸¥ Çϳª¸¦ ¸·À» ¼ö ¾ø´Â °÷¿¡ º¸ÅëÀº ´ç½ÅÀÌ È¯°æÀÇ ´õ ÁÁÀº ÀüüÀûÀÎ ÆÛÆ÷¸Õ½º¸¦ ¹ÞÀ» °ÍÀÌ´Ù. Understanding how your database manages locks can be critically important. Consider an orders table. New records are being added continuously as new orders are received. Because the order data does not include a field or fields which would form a natural primary key you decide to use an artificially generated order number as a surrogate key. Order numbers will be assigned sequentially as orders are received. Since your application will frequently need to select groups of orders you create a clustered index on the order number column. A clustered index provides superior performance when retrieving adjacent records because the records are physically stored in key order within the database pages. ¾î¶»°Ô ´ç½ÅÀÇ µ¥ÀÌÅͺ£À̽º°¡ ÀÚ¹°¼è¸¦ °ü¸®ÇÑ´Ù´Â °ÍÀ» ¾Æ´Â °ÍÀº ºñÆÇÀûÀ¸·Î Áß¿äÇÒ ¼ö ÀÖ´Ù.¿À´õ Å×À̺íÀ» °í·ÁÇØ¶ó.»õ·Î¿î ¿À´õ¸¦ ¹ÞÀ» ¶§ °è¼ÓÇÏ¿© »õ·Î¿î ±â·ÏÀ» ´õÇÑ´Ù.¿À´õ µ¥ÀÌÅͰ¡ Çʵ带 Æ÷ÇÔÇÏÁö ¾Ê°Å³ª °áÁ¤ÇÑ Çʵ尡 ÀÚ¿¬½º·¯¿î ±âº»Å°¸¦ ¸¸µé±â ¶§¹®¿¡ ´ç½ÅÀº ´ë¸®ÀÎÀÇ Å°·Î¼­ ÀÎÀ§ÀûÀ¸·Î ¸¸µé¾î ³» Áø ¿À´õ ¼ýÀÚ¸¦ »ç¿ëÇϱâ·Î °áÁ¤ÇÑ´Ù.¿À´õ¸¦ ¹ÞÀ» ¶§ ¿À´õ ¼ýÀÚ°¡ ¿¬¼ÓÀûÀ¸·Î ºÎ¿©µÉ °ÍÀÌ´Ù.ºó¹øÇÏ°Ô ´ç½ÅÀÇ ÀÀ¿ëÀÌ ¿À´õ ±×·ìÀ» ¼±ÅÃÇØ¾ß ÇÒ °ÍÀÎ ÀÌ·¡·Î ´ç½ÅÀº ¿À´õ ¼ýÀÚ Ä÷³ À§ÀÇ ¸ðÀÎ À妽º¸¦ ¸¸µç´Ù.ÀÎÁ¢ÇÑ ±â·ÏÀ» µÇãÀ» ¶§ À°Ã¼ÀûÀ¸·Î ±â·ÏÀÌ µ¥ÀÌÅͺ£À̽º ÆäÀÌÁö ¾È¿¡¼­ ÁÖ¿ä ¿À´õ¿¡ ÀúÀåÇØ Áö±â ¶§¹®¿¡ ¸ðÀÎ À妽º°¡ »óÀ§ ÆÛÆ÷¸Õ½º¸¦ Á¦°øÇÑ´Ù. Unfortunately this design is likely to produce poor performance if the database uses page level locking. Since sequential adjacent keys are being assigned and a clustered index is being used each new record that is added will probably be placed on the same page as the preceding record. Since the database locks at the page level two users cannot add new orders to the same page at the same time. Each new order must wait until the page lock placed by the preceding order is released. In this case you would get much better performance by assigning the keys randomly to reduce the chance that successive records will be added to the same page. ¸¸¾à µ¥ÀÌÅͺ£À̽º°¡ Àá±â¸é¼­ ÆäÀÌÁö ·¹º§À» »ç¿ëÇÑ´Ù¸é ºÒÇàÈ÷µµ ÀÌ µðÀÚÀÎÀº º¸Àß°Í ¾ø´ÂÀº ÆÛÆ÷¸Õ½º¸¦ ¸¸µé °Í °°´Ù.°è¼ÓÀûÀÎ ÀÎÁ¢ÇÑ Å°°¡ Àç»ê±ÇÀ» ¾çµµÇØ Áö°í ¸ðÀÎ À妽º°¡ »ç¿ëµÈ ÀÌ·¡·Î ¾Æ¸¶ ´õÇÏ´Â °¢ »õ·Î¿î ±â·ÏÀÌ ¼±ÇàÇϰí ÀÖ´Â ±â·Ï°ú °°Àº ÆäÀÌÁö¿¡ µÖ Áú °ÍÀÌ´Ù.µ¥ÀÌÅͺ£À̽º°¡ ±ÕÀÏÇÑ 2 ÆäÀÌÁö¿¡(¼­)Àá±â´Â ÀÌ·¡·Î »ç¿ëÀÚ´Â µ¿½Ã¿¡ ¶È°°Àº ÆäÀÌÁö¿¡ »õ·Î¿î ¿À´õ¸¦ Ãß°¡ÇÒ ¼ö ¾ø´Ù.°¢ »õ·Î¿î ¿À´õ´Â ¼±ÇàÇϰí ÀÖ´Â ¿À´õ¿¡ ÀÇÇÏ¿© ³õÀÎ ÆäÀÌÁö ÀÚ¹°¼è°¡ ¹ßÇ¥µÉ ¶§±îÁö ±â´Ù·Á¾ß ÇÑ´Ù.ÀÌ °æ¿ì¿¡´Â ´ç½ÅÀº ¸¶±¸ÀâÀ̷ΠŰ¿¡°Ô ¿¬¼ÓÇÑ ±â·ÏÀÌ ¶È°°Àº ÆäÀÌÁö¿¡ Ãß°¡µÈ Âù½º¸¦ Á¶Á¤Çϵµ·Ï Áö½ÃÇÔÀ¸·Î½á ÈξÀ ´õ ÁÁÀº ÆÛÆ÷¸Õ½º¸¦ ¹ÞÀ» °ÍÀÌ´Ù. Transactions °Å·¡ Another requirement of database servers is the ability to group changes to the database into transactions. Update transactions consist of one or more changes to one or more tables in the database which must be treated as a single unit so that either all of the changes that comprise the transaction take place or none of the changes take place. µ¥ÀÌÅͺ£À̽º ¼­¹öÀÇ ´Ù¸¥ ¿ä°ÇÀº µ¥ÀÌÅͺ£À̽º¿¡ ´ëÇÑ Ã¼ÀÎÁö¸¦ °Å·¡º°·Î ºÐ·ùÇÒ ´É·ÂÀÌ´Ù.¶ÇÇÑ °Å·¡·Î ±¸¼ºµÈ ¸ðµç üÀÎÁö°¡ ÀϾ°Å³ª ¾î¶² üÀÎÁöµµ ÀϾÁö ¾Êµµ·Ï ¾÷µ¥ÀÌÆ® °Å·¡´Â ´ÜÇϳªÀÇ À¯´Ö Ãë±ÞÇØ Á®¾ß ÇÏ´Â µ¥ÀÌÅͺ£À̽ºÀÇ Çϳª ÀÌ»ó Å×ÀÌºí¿¡ ´ëÇÑ Çϳª ÀÌ»ó üÀÎÁö·Î ±¸¼ºµÈ´Ù. Transaction processing takes place in three steps. First you tell the database software that you wish to begin a transaction. This informs the database system that all changes until further notice are to be treated as a single unit. Next, the changes are actually made to the tables in the database. Finally, you notify the database system that you wish to either commit or rollback the transaction. If you commit the transaction then the changes become permanent. If you rollback the transaction all of the changes are undone. °Å·¡ ÇÁ·Î¼¼½ÌÀº ¼¼ ½ºÅÜ¿¡¼­ ¿­¸°´Ù.óÀ½À¸·Î ´ç½ÅÀº µ¥ÀÌÅͺ£À̽º ¼ÒÇÁÆ®¿þ¾î¿¡°Ô ´ç½ÅÀÌ °Å·¡¸¦ ½ÃÀÛÇÏ°í ½Í´Ù°í ¸»ÇÑ´Ù.À̰ÍÀº ÃßÈÄ ÅëÁö°¡ ÀÖÀ» ¶§±îÁö ¸ðµç üÀÎÁö´Â ´ÜÇϳªÀÇ À¯´Ö Ãë±ÞÇØ Áö´Â °ÍÀ̶ó°í µ¥ÀÌÅͺ£À̽º ½Ã½ºÅÛ¿¡°Ô ¾Ë¸°´Ù.µ¥ÀÌÅͺ£À̽ºÀÇ Å×ÀÌºí¿¡(°Ô)´ÙÀ½¿¡ ½ÇÁ¦·Î üÀÎÁö¸¦ ÇÑ´Ù.¸¶Ä§³» ´ç½ÅÀº °Å·¡ ´ç½ÅÀÌ ¶ÇÇÑ ¹üÇϱ⸦ ¹Ù¶ó´Â µ¥ÀÌÅͺ£À̽º ½Ã½ºÅÛÀ̳ª ·Ñ¹éÁ¤Ã¥À» ¾Ë¸°´Ù.¸¸¾à ´ç½ÅÀÌ °Å·¡¸¦ ¿Ï·áÇÑ´Ù¸é ±× °æ¿ì¿¡´Â üÀÎÁö´Â ¿µ±¸ÀûÀÌ°Ô µÈ´Ù.¸ðµç üÀÎÁö°¡ ÀÖ´Â °Å·¡ ¸¸¾à ´ç½Å ·Ñ¹éÁ¤Ã¥ ¿ø»óÅ·Πµ¹·Á Áö´Â °Í. Transaction processing is vital to ensure the logical integrity of the database. Consider the case where John transfers $100 from his savings account to his checking account. This transaction would proceed as follows. °Å·¡ ÇÁ·Î¼¼½ÌÀº µ¥ÀÌÅͺ£À̽ºÀÇ ³í¸®ÀûÀÎ ¿ÏÀü¼ºÀ» È®½ÇÇÏ°Ô Çϱâ À§ÇØ È°·Â ÀÖ´Ù.Á¸ÀÌ $100À» ±×ÀÇ ¿¹±Ý °èÁ¿¡¼­ ±×ÀÇ ¾îÄ«¿îÆ®¸¦ üũÇÏ´Â °ÍÀ¸·Î ¿Å±â´Â °÷¿¡ ÄÉÀ̽º¸¦ °í·ÁÇØ¶ó.ÀÌ °Å·¡´Â ´ÙÀ½°ú °°ÀÌ °è¼Ó ³ª¾Æ°¥ °ÍÀÌ´Ù. Start a new transaction. »õ·Î¿î °Å·¡¸¦ ½ÃÀÛÇØ¶ó. Update the balance in the savings account to show a withdrawal of $100. $100ÀÇ Ã¶È¸¸¦ º¸À̱â À§ÇØ ¿¹±Ý °èÁÂÀÇ ¹ë·±½º¸¦ ¾÷µ¥ÀÌÆ®Çضó. Update the balance in the checking account to show an increase of $100. $100ÀÇ Áõ°¡¸¦ º¸À̱â À§ÇØ ÀºÇà ´çÁ ¿¹±ÝÀÇ ¹ë·±½º¸¦ ¾÷µ¥ÀÌÆ®Çضó. Either commit or rollback the transaction. ¶ÇÇÑ ±×·¸Áö ¾ÊÀ¸¸é ·Ñ¹éÁ¤Ã¥ °Å·¡ ¹üÇÏ¿©¶ó. Suppose the system crashes after step two but before step 3. Without transaction control John would have lost $100. With transaction control, when the system is restarted the database software will automatically rollback any transactions that had not been committed at the time of the crash. This guarantees that the database will be left in a consistent state. ½Ã½ºÅÛÀÌ 2 ´Ü°è ÈÄ¿¡ ±×·¯³ª 3 ´Ü°è ¾Õ¿¡¼­ ºÎ¼­Áø´Ù°í °¡Á¤Çضó.°Å·¡ ÄÁÆ®·Ñ ¾øÀÌ Á¸Àº ÀÒ¾î¹ö¸° $100À» °¡Áö°í ÀÖÀ» °ÍÀÌ´Ù.½Ã½ºÅÛÀÌ Àç°³µÉ ¶§ °Å·¡ ÄÁÆ®·ÑÀ» °¡Áö°í µ¥ÀÌÅͺ£À̽º ¼ÒÇÁÆ®¿þ¾î´Â Ãæµ¹ÀÇ ½Ã°£¿¡ committedÀÌÁö ¾ÊÀº ¸ðµç °Å·¡ ÀÚµ¿ÀûÀ¸·Î ·Ñ¹éÁ¤Ã¥ °áÁ¤ÇÑ´Ù.À̰ÍÀº µ¥ÀÌÅͺ£À̽º°¡ ÀϰüµÈ ½ºÅ×ÀÌÆ®¿¡ ³²°Ü µÎ¾î Áú °ÍÀ̶ó°í º¸ÀåÇÑ´Ù. You also need transaction control for read transactions that will read more than a single record to ensure that the read returns a consistent view of the data. This requirement is described in more detail in the next section. ¶ÇÇÑ ´ç½ÅÀº ´ÜÇϳªÀÇ ±â·Ïº¸´Ù ±× ÀÌ»óÀ» ÀÐÀ» Àб⠰ŷ¡°¡ ÀбⰡ µ¥ÀÌÅÍÀÇ ÀϰüµÈ ºä¸¦ µÇµ¹·ÁÁÖ¶ó´Â °ÍÀ» È®½ÇÇÏ°Ô ÇÏ´Â °Í °Å·¡ ÄÁÆ®·ÑÀÌ ÇÊ¿äÇÑ´Ù.´ÙÀ½ ¼½¼ÇÀÇ ´õ ¸¹Àº »ó¼¼È÷ ÀÌ ¿ä°ÇÀ» ¹¦»çÇÑ´Ù. Transaction Isolation °Å·¡ °í¸³ Transaction isolation governs how transactions that are executing simultaneously interact with each other. Many of today¡¯s database servers were originally designed to process very short update transactions intermixed with single row reads. The perfect example is a bank automated teller (ATM). An ATM reads the balance in a single account or updates the balance in one or more accounts. In this environment, transactions are very short and reads involve a single row at a time so transaction isolation is not a serious concern. However, many of today¡¯s database applications do not fit that model. °Å·¡ °í¸³Àº ¾î¶»°Ô µ¿½Ã¿¡ ¼öÇàÇϰí ÀÖ´Â °Å·¡°¡ ¼­·Î¿Í ¼­·Î ¿µÇâÀ» ¹ÌÄ¡°Ô ´Ù½º¸°´Ù.¿ø·¡´Â ¿À´ÃÀÇ µ¥ÀÌÅͺ£À̽º ´Ù¼öÀÇ ¼­¹ö°¡ ´ÜÇϳªÀÇ ÁÙ Àбâ¿Í ¼¯¾î Áø ¸Å¿ì °£°áÇÑ ¾÷µ¥ÀÌÆ® °Å·¡¸¦ ó¸®Çϵµ·Ï ¸¸µé¾îÁ³´Ù.¿Ïº®ÇÑ ¿¹´Â ¹ðÅ© ÀÚµ¿È­µÈ È­ÀÚ(ºñµ¿±â Àü¼Û¸ðµå)ÀÌ´Ù.ºñµ¿±â Àü¼Û¸ðµå°¡ ´ÜÇϳªÀÇ ¾îÄ«¿îÆ®ÀÇ ¹ë·±½º¸¦ Àаųª Çϳª ÀÌ»ó ¾îÄ«¿îÆ®ÀÇ ¹ë·±½º¸¦ ¾÷µ¥ÀÌÆ®ÇÑ´Ù.°Å·¡°¡ ¸Å¿ì ª°í Àбâ´Â Çѹø¿¡ ´ÜÇϳªÀÇ ÁÙÀ» ÀÌ È¯°æ¿¡ ²ø¾î³Ö´Â´Ù ±×·¡¼­ °Å·¡ °í¸³ÀÌ Áß´ëÇÑ °ü½ÉÀÌ ¾Æ´Ï´Ù.±×·¯³ª ¿À´ÃÀÇ µ¥ÀÌÅͺ£À̽º ´Ù¼öÀÇ ÀÀ¿ë ÇÁ·Î±×·¥Àº ±× ¸ðµ¨¿¡°Ô ¸ÂÁö ¾Ê´Â´Ù. Short update transactions are still the norm but the advent of executive information systems has introduced long running read transactions that span whole tables and sometimes entire databases. To understand the problem with long read transactions consider the following scenario. °£°áÇÑ ¾÷µ¥ÀÌÆ® °Å·¡°¡ ¾ÆÁ÷µµ Ç¥ÁØÀÌÁö¸¸ °æ¿µ °£ºÎ Á¤º¸ ½Ã½ºÅÛÀÇ ÃâÇöÀÌ ¸ðµç Å×À̺í°ú ¶§¶§·Î Àüü µ¥ÀÌÅͺ£À̽º¿¡ À̸£´Â ±ä ´Þ¸®°í ÀÖ´Â Àб⠰ŷ¡¸¦ ¼Ò°³Çß´Ù.±ä Àб⸦ °¡Áö°í ¹®Á¦¸¦ Àß ¾Ë±â À§ÇØ °Å·¡´Â ´ÙÀ½ ½Ã³ª¸®¿À¸¦ °í·ÁÇÑ´Ù. An executive requests the total value of the company¡¯s inventory by warehouse. While the query is scanning the inventory table a user moves a pallet of platinum bars from warehouse A to warehouse B and commits the transaction. It is possible for the query to count the platinum in both warehouse A and warehouse B thus producing an erroneous inventory valuation report. The question then becomes, which updates should a read transaction see and when should it see them? This is what the transaction isolation level controls. There are four isolation levels defined in the SQL 92 standard as follows. °æ¿µ °£ºÎ°¡ â°í¿¡ ÀÇÇÏ¿© ÄÄÆÛ´ÏÀÇ Ç°¸ñÀ϶÷ÀÇ ÀüüÀûÀÎ °¡Ä¡¸¦ ºÎŹÇÑ´Ù.Áú¹®ÀÌ »ç¿ëÀÚ°¡ ¿òÁ÷À̴ ǰ¸ñÀ϶÷ Å×À̺íÀ» »ìÆìº¸°í ÀÖ´Â µ¿¾È ¹é±ÝÀÇ ÆÈ·¹Æ®°¡ BÀ» â°í¿¡ ³Ö±â À§ÇØ AÀ» â°í¿¡¼­ Á¦¿ÜÇÏ°í °Å·¡¸¦ ¿Ï·áÇÑ´Ù.Áú¹®ÀÌ A â°í¿Í ÀÌ·¸°Ô À߸øµÈ ǰ¸ñÀ϶÷ Æò°¡ ¸®Æ÷Æ®¸¦ ¸¸µé°í ÀÖ´Â B â°í µÑ ´ÙÀÇ ¹é±ÝÀ» ¼¼´Â °ÍÀº °¡´ÉÇÏ´Ù.Àб⠰ŷ¡°¡ ¾î´À ¾÷µ¥ÀÌÆ®¸¦ º¸¾Æ¾ß ÇÕ´Ï±î ¾ðÁ¦ ±×°ÍÀÌ º¸¾Æ¾ß ÇÕ´Ï±î ±×¶§ Áú¹® ±×µé µË´Ï±î?À̰ÍÀº °Å·¡ °í¸³ ·¹º§ÀÌ ÄÁÆ®·ÑÇÏ´Â °ÍÀÌ´Ù.´ÙÀ½°ú °°ÀÌ SQL ±âÁØ 92 ±Ç¿¡(¼­)Á¤ÀÇÇÑ 4 °í¸³ ·¹º§ÀÌ ÀÖ´Ù. Read Uncommitted - this isolation level, sometimes called dirty read, allows any record in the database to be read whether it has been committed or not. ¶§¶§·Î ´õ·¯¿î Àбâ¶ó°í ºÒ¸®´Â ÀÌ °í¸³ ·¹º§ÀÌ ±×°ÍÀÌ committedÀ̾ú´ÂÁö ¾Æ´ÑÁö ÀÐÈ÷±â À§ÇØ µ¥ÀÌÅͺ£À̽º¿¡(¼­)¸ðµç ±â·ÏÀ» Çã¶ôÇÏÁö ÀúÁö¸£Áö ¾Ê°Ô ÀÐÇô¶ó. Read Committed - this level allows read transactions to see only those changes that have been committed. ¹üÇÏ¿©¼­ Àоî¶ó-ÀÌ ·¹º§ÀÌ Àб⠰ŷ¡°¡ committedÀ̾ú´ø ±× üÀÎÁöµé¸¸À» º¸µµ·Ï Çã¶ôÇØ¶ó. Repeatable Read - ensures that if your transaction rereads records that it has read earlier it will find the same values in all of the fields of those records. This does not mean that you will get the same set of records on the second read. For example, if another transaction inserts a record that meets the criteria of the WHERE clause in your select you will see this new record the second time your transaction executes the SELECT. ¹Ýº¹µÉ ¼ö ÀÖ´Â Àбâ´Â ¸¸¾à ´ç½ÅÀÇ °Å·¡°¡ ±×°ÍÀÌ ´õ ÀÏÂï ÀÐÀº ±â·ÏÀ» ´Ù½Ã ÀÐ´Â´Ù¸é ±×°ÍÀÌ ¶È°°Àº °¡Ä¡°üÀ» ±× ±â·ÏµéÀÇ ¸ðµç Çʵ忡¼­ ¹ß°ßÇÒ °ÍÀ̶ó´Â °ÍÀ» È®½ÇÇÏ°Ô ÇÑ´Ù.À̰ÍÀº ´ç½ÅÀÌ ÀÐÈù µÎ ¹øÂ° À§¿¡¼­ ¶È°°Àº ±â·Ï ¼¼Æ®¸¦ ¾òÀ» °ÍÀ» ÀǹÌÇÏÁö ¾Ê´Â´Ù.¸¸¾à ´Ù¸¥ °Å·¡°¡ ±â·ÏÀ» »ðÀÔÇÑ´Ù¸é ¿¹¸¦ µé¸é ±×°ÍÀº ´ç½ÅÀÌ ´ç½ÅÀÇ °Å·¡°¡ ¼öÇàÇÏ´Â µÎ ¹øÂ° ÀÌ »õ·Î¿î ±â·ÏÀ» º¼ °Í ¾îµð¿¡ Á¶Ç× ´ç½ÅÀÇ ¼±ÅÃÇØ¶ó ¼±ÅÃÇØ¶ó ±âÁØÀ» ¸¸³­´Ù. Serializable - ensures that if you issue the same SELECT multiple times during the life of your transaction you will see exactly the same set of records with the same values in every field. It also ensures that there is some serial order of concurrent transactions that will produce the same result as that produced by concurrent execution. Interbase's snapshot transaction isolation level provides the same degree of isolation from changes made by other transactions as serializable. Serializable ¸¸¾à ´ç½ÅÀÌ ´ç½ÅÀÇ °Å·¡ÀÇ »ý¸í(»î)µ¿¾È ¶È°°Àº ¾ö¼±µÈ ´ÙÁß ½Ã°£À» ³»¸°´Ù¸é ´ç½ÅÀÌ ¶È°°Àº °¡Ä¡°üÀ» °¡Áö°í ¸ðµç Çʵ忡(¼­)Á¤È®ÇÏ°Ô ¶È°°Àº ±â·Ï ¼¼Æ®¸¦ º¼ °ÍÀ̶ó´Â °ÍÀ» È®½ÇÇÏ°Ô ÇÑ´Ù.¶ÇÇÑ ±×°ÍÀº µ¿½Ã ½ÇÇà¿¡ ÀÇÇÏ¿© º¸¿© ÁÖ¾î Áø ±×°Í°ú °°Àº °á°ú¸¦ º¸¿© ÁÙ µ¿½Ã °Å·¡ÀÇ ¸î¸îÀÇ ¿¬¼ÓÀûÀÎ ¿À´õ°¡ ÀÖ´Ù´Â °ÍÀ» È®½ÇÇÏ°Ô ÇÑ´Ù.InterbaseÀÇ ½º³À»çÁø °Å·¡ °í¸³ ·¹º§Àº serializableÀÏ ¶§ ´Ù¸¥ °Å·¡¿¡ ÀÇÇÏ¿© ¸¸µé¾î Áø üÀÎÁö·ÎºÎÅÍ °í¸³ÀÇ ¶È°°Àº Á¤µµ¸¦ Á¦°øÇÑ´Ù. In the example above what you need to ensure that your inventory valuation report is accurate is serializable isolation. The problem is the price that you must pay to get serializable isolation in a database that uses locking architecture. With the locking model the only way to ensure that data does not change during a long read transaction is to prevent any updates from taking place until the read transaction ends by locking each record as it is read. In many situations the effect on users of stopping all updates on a large number of rows for the duration of a long read transaction is unacceptable. serializable °í¸³Àº ´ç½ÅÀÌ ´ç½ÅÀÇ Ç°¸ñÀ϶÷ Æò°¡ ¸®Æ÷Æ®°¡ Á¤È®ÇÏ´Ù´Â °ÍÀ» È®½ÇÇÏ°Ô ÇØ¾ß ÇÏ´Â °Í À§¿¡ ¿¹¿¡ ÀÖ´Ù.¹®Á¦´Â ´ç½ÅÀÌ Àá±â°í ÀÖ´Â °ÇÃàÀ» »ç¿ëÇÏ´Â µ¥ÀÌÅͺ£À̽ºÀÇ serializable °í¸³À» ¾ò´Â °Í ÁöºÒÇØ¾ß ÇÏ´Â °¡°ÝÀÌ´Ù.Àá±â°í ÀÖ´Â ¸ðµ¨À» °¡Áö°í µ¥ÀÌÅͰ¡ ±ä Àб⠰ŷ¡ µ¿¾È º¯ÇÏÁö ¾ÊÀ¸¶ó´Â °ÍÀ» È®½ÇÇÏ°Ô Çϱâ À§ÇÑ ¹æ¹ý¸¸Àº ¸ðµç ¾÷µ¥ÀÌÆ®°¡ ±×°ÍÀ» ÀÐÀ» ¶§ °¢ ±â·ÏÀ» Àá±ÝÀ¸·Î½á Àб⠰ŷ¡ ¸ñÀû±îÁö ÀϾÁö ¸øÇÏ´Â °ÍÀÌ´Ù.¸¹Àº »óȲ¿¡(¼­)±ä Àб⠰ŷ¡ÀÇ Áö¼Ó±â°£À» À§ÇØ ¸¹Àº ÁÙ À§ÀÇ ¸ðµç ¾÷µ¥ÀÌÆ®¸¦ ¸ØÃß´Â »ç¿ëÀÚ¿¡ ´ëÇÑ È¿°ú´Â ¹Þ¾ÆµéÀÏ ¼ö ¾ø´Ù. Versioning Versioning There is another model for concurrency control called versioning which overcomes the problems that locking model databases have when the environment consists of a mixture of update and long read transactions. This model is called the versioning model and is the model used by Interbase. To understand the basics of the versioning model consider the preceding example. With a versioning database the read transaction to produce the inventory valuation report begins. When the update transaction to move the pallet of platinum from warehouse A to warehouse B is committed a new version of each updated record is created, however, the old version still exists in the database. ȯ°æÀÌ ¾÷µ¥ÀÌÆ®¿Í ±ä Àб⠰ŷ¡ÀÇ È¥ÇÕÀ¸·Î ±¸¼ºµÉ ¶§ Àá±â°í ÀÖ´Â ¸ðµ¨ µ¥ÀÌÅͺ£À̽º°¡ °¡Áö°í ÀÖ´Â ¹®Á¦¸¦ ±Øº¹ÇÏ´Â versioningÀ̶ó°í ºÒ¸®´Â µ¿½Ã Á¦¾î¸¦ À§ÇÑ ´Ù¸¥ ¸ðµ¨ÀÌ ÀÖ´Ù.versioning ¸ðµ¨À̶ó°í ºÒ¸®°í ÀÌ ¸ðµ¨Àº Interbase¿¡ ÀÇÇÏ¿© »ç¿ëµÈ ¸ðµ¨ÀÌ´Ù.ÀÌÇØÇϱâ À§ÇØ versioning ¸ðµ¨ÀÇ º£ÀÌÁ÷Àº ¼±ÇàÇϰí ÀÖ´Â ¿¹¸¦ °í·ÁÇÑ´Ù.versioning µ¥ÀÌÅͺ£À̽º¸¦ °¡Áö°í ǰ¸ñÀ϶÷ Æò°¡ ¸®Æ÷Æ®¸¦ ¸¸µé Àб⠰ŷ¡´Â ½ÃÀ۵ȴÙ.BÀ» â°í¿¡ ³ÖÀ» A â°í·ÎºÎÅÍ ¹é±ÝÀÇ ÆÈ·¹Æ®¸¦ ¿òÁ÷ÀÏ ¾÷µ¥ÀÌÆ® °Å·¡°¡ committedÀÏ ¶§ °¢ ¾÷µ¥ÀÌÆ®µÈ ±â·ÏÀÇ »õ·Î¿î ¹öÀüÀÌ ¸¸µé¾î Áø´Ù.±×·¯³ª ¾ÆÁ÷µµ ¿À·¡µÈ ¹öÀüÀº µ¥ÀÌÅͺ£À̽º¿¡(¼­)Á¸ÀçÇÑ´Ù. In a versioning database each transaction is assigned a sequential transaction number. In addition, the database manager maintains an inventory of all active transactions. The transaction inventory pages show whether the transaction is active, committed or rolled back. versioning µ¥ÀÌÅͺ£À̽º¿¡(¼­)°¢ °Å·¡°¡ °è¼ÓÀûÀÎ °Å·¡ ¼ýÀÚ¸¦ ºÎ¿©ÇØ Áø´Ù.°Ô´Ù°¡ µ¥ÀÌÅͺ£À̽º ¸Å´ÏÀú´Â ¼ö¸¹Àº Ȱ¹ßÇÑ °Å·¡ °¡¿îµ¥¿¡¼­ ǰ¸ñÀ϶÷À» À¯ÁöÇÑ´Ù.°Å·¡ ǰ¸ñÀ϶÷ ÆäÀÌÁö´Â °Å·¡°¡ Ȱ¹ßÇϰųª committedÀ̰ųª Ãë¼ÒÇÏ´ÂÁö ¾Æ´ÑÁö´ÂÁö¸¦ º¸¿©ÁØ´Ù. When an update transaction commits, the database software checks to see if there are transactions with lower transaction numbers that are still active. If so then a new version of the record is created which contains the updated values. Each version also contains the transaction number of the transaction that created it. Note that Interbase does not create a complete copy of the row. Instead it creates a difference record that only contains the fields that were changed. ¾÷µ¥ÀÌÆ® °Å·¡°¡ ¹üÇÒ ¶§ µ¥ÀÌÅͺ£À̽º ¼ÒÇÁÆ®¿þ¾î´Â ¸¸¾à ¾ÆÁ÷µµ Ȱ¹ßÇÑ °Å·¡ ÀÛÀº ¼ö¸¦ °¡Áö°í °Å·¡°¡ Àִ´ٸéÀ» º¸´Â °Í üũÇÑ´Ù.±×·¸´Ù¸é ±×¶§ ±â·ÏÀÇ »õ·Î¿î ¹öÀüÀÌ ¾î´À °ÍÀÌ ¾÷µ¥ÀÌÆ®µÈ °¡Ä¡°üÀ» °¡Áö°í ÀÖ ¸¸µé¾î Áø´Ù.¶ÇÇÑ °¢ ¹öÀüÀº ±×°ÍÀ» ¸¸µç °Å·¡ÀÇ °Å·¡ ¼ýÀÚ¸¦ °¡Áö°í ÀÖ´Ù.InterbaseÀÌ ÁÙÀÇ ¿ÏÀüÇÑ Ä«ÇǸ¦ ¸¸µéÁö ¾Ê´Â´Ù´Â °ÍÀ» ¾ð±ÞÇØ¶ó.±× ´ë½Å ±×°ÍÀº ´ÜÁö ¹Ù²ï Çʵ带 °¡Áö°í ÀÖ´Â Â÷ÀÌ ±â·ÏÀ» ¸¸µç´Ù. When a read transaction begins it gets the next transaction number and a copy of the transaction inventory pages that show the status of all transactions that have not yet committed. As a read transaction requests each row in a table the database software checks to see if the transaction number for the latest version of the row is greater than the transaction number of the transaction that is requesting the row and if the transaction was committed at the time the read transaction started. If the transaction number of the latest version of the row is greater than the number of the requesting transaction or if the transaction that created the latest version was active when the read transaction started Interbase looks back through the chain of prior versions until it encounters one whose transaction number is less than the transaction number of the transaction trying to read the row and whose transaction status was committed at the time the read transaction started. When the database manager finds the most recent version that meets these criteria it returns that version. The result is serializable transaction isolation without preventing updates during the life of the read transaction. Àб⠰ŷ¡°¡ ½ÃÀÛµÉ ¶§ ±×°ÍÀº ´ÙÀ½ °Å·¡ ¼ýÀÚ¿Í ¼ö¸¹Àº ¾ÆÁ÷ ¹üÇÏÁö ¾Ê¾Ò´ø °Å·¡ °¡¿îµ¥¿¡¼­ ½ºÅ×ÀÌÅͽº¸¦ º¸ÀÌ´Â °Å·¡ ǰ¸ñÀ϶÷ ÆäÀÌÁöÀÇ Ä«ÇǸ¦ ¾ò´Â´Ù.Àб⠰ŷ¡°¡ Å×À̺íÀÇ °¢ ÁÙÀ» ºÎŹÇÒ ¶§ µ¥ÀÌÅͺ£À̽º ¼ÒÇÁÆ®¿þ¾î´Â ¸¸¾à ÁÙÀÇ °¡Àå ÃÖ±ÙÀÇ ¹öÀüÀ»À§ÇÑ °Å·¡ ¼ýÀÚ°¡ ÁÙÀ» ºÎŹÇϰí ÀÖ´Â °Å·¡ÀÇ °Å·¡ ¼ýÀÚ greater than ¸¸¾à °Å·¡°¡ Àб⠰ŷ¡°¡ ½ÃÀÛµÈ ½Ã°£¿¡ committedÀ̾ú´Ù¸é´Â´Ù¸éÀ» º¸´Â °Í üũÇÑ´Ù.¸¸¾à °Å·¡ ¼ýÀÚ °¡Àå ´Ê°Ô ¹öÀü ÀÖ°Ô ´õÇÑ ¼ýÀÚ ºÎŹÇÏ´Â °Å·¡ ±×·¸Áö ¾ÊÀ¸¸é ¸¸¾à °Å·¡ ±×°Í ¸¸µé¾î Áö °¡Àå ´Ê°Ô ¹öÀü Àִ Ȱ¹ßÇÑ ¾ðÁ¦ ÀÐÇô¶ó °Å·¡ Interbase ¸ð½À µÚ·Î ¹°·¯³ª¶ó.µ¥ÀÌÅͺ£À̽º ¸Å´ÏÀú°¡ ÀÌ ±âÁØÀ» ¸¸³ª´Â °¡Àå ÃֽйöÀüÀ» ¹ß°ßÇÒ ¶§ ±×°ÍÀº ±× ¹öÀüÀ» µÇµ¹·ÁÁØ´Ù.°á°ú´Â »ý¸í(»î)µ¿¾È ¾øÀÌ ¾÷µ¥ÀÌÆ®¸¦ ¸·°í ÀÖ´Â Àб⠰ŷ¡ÀÇ serializable °Å·¡ °í¸³ÀÌ´Ù. Consider the following example of a row for which four versions exist. ¹öÀü 4 ±ÇÀÌ Á¸ÀçÇÏ´Â ÁÙÀÇ ´ÙÀ½ ¿¹¸¦ °í·ÁÇØ¶ó. Tran=100 (status=committed) Tran=100(status=committed) Tran=80 (status=active when read started) Tran=80(ÀÐÈú ¶§ status=active) Tran=60 (status=rolled back) Tran=60(status=rolled ¹é) Tran=40 (status = committed when read started) Tran=40(ÀÐÈú ¶§ ¹üÇÑ = ½ºÅ×ÀÌÅͽº) Assume that a read transaction with transaction number 90 attempts to read this row. The read transaction will not see the version of the row created by transaction 100 because the update that created this version took place after transaction 90 began. Transaction 90 also will not be able to read the version created by transaction 80 although it has a lower transaction number because transaction 80 has not committed yet. Although the version for transaction 60 still exists on disk transaction 60 has rolled back and rolled back versions are always ignored. Therefore, the version that transaction 90 will read is the version created by transaction 40. °Å·¡ 90 ¹øÀ» °¡Áö°í Àб⠰ŷ¡°¡ ÀÌ ÁÙÀ» ÀÐÀ¸·Á°í ÇÑ´Ù°í »ý°¢Çضó.°Å·¡ 90ÀÌ ½ÃÀÛµÈ ÈÄ¿¡ ÀÌ ¹öÀüÀ» ¸¸µç ¾÷µ¥ÀÌÆ®°¡ ÀϾ±â ¶§¹®¿¡ Àб⠰ŷ¡´Â °Å·¡ 100¿¡ ÀÇÇÏ¿© ¸¸µé¾î Áö´Â ÁÙÀÇ ¹öÀüÀ» º¸Áö ¾ÊÀ» °ÍÀÌ´Ù.ºñ·Ï °Å·¡ 80ÀÌ ¾ÆÁ÷ ¹üÇÏÁö ¾Ê¾Ò±â ¶§¹®¿¡ ±×°ÍÀÌ °Å·¡ ÀÛÀº ¼ö¸¦ °¡Áö°í ÀÖ±â´Â ÇÏÁö¸¸ ¶ÇÇÑ °Å·¡ 90Àº °Å·¡ 80¿¡ ÀÇÇÏ¿© ¸¸µé¾î Áø ¹öÀüÀ» ÀÐÀ» ¼ö ÀÖÁö ¾ÊÀ» °ÍÀÌ´Ù.ºñ·Ï ¾ÆÁ÷µµ °Å·¡ 60À»À§ÇÑ ¹öÀüÀÌ Á¸ÀçÇϱâ´Â ÇÏÁö¸¸ µð½ºÅ© °Å·¡ À§¿¡¼­ 60ÀÌ Ãë¼ÒÇß°í ¾ðÁ¦³ª µ¹µ¹ ¸¸ µÚ ¹öÀüÀÌ ¹«½Ã ´çÇÑ´Ù.µû¶ó¼­ ±× °Å·¡ 90ÀÌ ÀÐÀ» °ÍÀÎ ¹öÀüÀº °Å·¡ 40¿¡ ÀÇÇÏ¿© ¸¸µé¾î Áø ¹öÀüÀÌ´Ù. Note in this example that transaction 80 will not be allowed to commit. When transaction 80 attempts to commit the database manager will discover that transaction 100 has committed and transaction 80 will be rolled back. ÀÌ ¿¹¿¡¼­ °Å·¡ 80ÀÌ ¹üÇϵµ·Ï Çã¶ô ¹ÞÁö ¾ÊÀ» °ÍÀÎ °ÍÀ» ¾ð±ÞÇØ¶ó.°Å·¡ 80ÀÌ ¹üÇÏ·Á°í ÇÒ ¶§ µ¥ÀÌÅͺ£À̽º ¸Å´ÏÀú´Â °Å·¡ 100ÀÌ ¹üÇÏ¿´°í °Å·¡ 80ÀÌ Ãë¼ÒÇØ Áú °ÍÀÓÀ» ¾Ë°Ô µÉ °ÍÀÌ´Ù. How They Compare ¾î¶»°Ô ±×µéÀº ºñ±³ÇÑ´Ù. To get a more complete understanding of how the locking and versioning models compare you need to look at the types of concurrency conflicts that can occur in a multi-user database and how each model behaves in each case. The following examples assume that the locking model uses a shared read lock and an exclusive write lock to implement optimistic locking. Multiple users can place read locks but no user can place a write lock if another user has either a read or write lock. If one user has a write lock another user can neither read or write the row. This is typical of databases that use locking architecture. In the following examples three scenarios are explored. The first is what happens with no concurrency control, the second is what happens using the locking model and the third is what happens with versioning. Àá°Ü±â,versioning ¸ðµ¨ÀÌ ºñ±³ÇÏ´Â ´õ ¿ÏÀüÇÑ ¾î¶»°ÔÀ» ÀÌÇØÇϱâ À§ÇØ ´ç½ÅÀÌ À¯ÇüÀÇ multi-user µ¥ÀÌÅͺ£À̽º¿¡(¼­)ÀϾ ¼ö ÀÖ´Â º´Ç༺ ´ë¸³À» º¸¾Æ¾ß ÇÏ°í ¾î¶»°Ô °¢ ¸ðµ¨Àº °¢ ÄÉÀ̽º¿¡(¼­)ÇൿÇÑ´Ù.´ÙÀ½ ¿¹´Â Àá±â°í ÀÖ´Â ¸ðµ¨ÀÌ ÀÚ¹°¼è¿Í µ¶Á¡ ÆÇ¸Å°¡ µµ±¸ ³«ÃµÀûÀÌ°Ô Àá±×´Â °Í¿¡ ÀÚ¹°¼è¸¦ ¾²´Â ÇÔ²² ³ª´² Áø Àб⸦ »ç¿ëÇÑ´Ù°í »ý°¢ÇÑ´Ù.¸¸¾à ´Ù¸¥ »ç¿ëÀÚ°¡ ¶ÇÇÑ Àб⳪ ±â·Ï ÀÚ¹°¼è¸¦ °¡Áö°í ÀÖ´Ù¸é ´ÙÁß »ç¿ëÀÚ°¡ Àбâ ÀÚ¹°¼è¸¦ µÑ ¼ö ÀÖÁö¸¸ »ç¿ëÀÚ°¡ ±â·Ï ÀÚ¹°¼è¸¦ µÎÁö ¾ÊÀ» ¼ö ÀÖ´Ù.¸¸¾à Çϳª »ç¿ëÀÚ°¡ ±â·Ï ÀÚ¹°¼è¸¦ °¡Áö°í ÀÖ´Ù¸é ´Ù¸¥ »ç¿ëÀÚ°¡ ÁÙÀ» ÀÐÀ» ¼ö Àְųª ¾µ ¼ö ¾ø´Ù.À̰ÍÀº Àá±â°í ÀÖ´Â °ÇÃàÀ» »ç¿ëÇÏ´Â µ¥ÀÌÅͺ£À̽ºÀÇ ÀüÇüÀûÀÌ´Ù.´ÙÀ½ ¿¹¿¡(¼­)½Ã³ª¸®¿À 3 ±ÇÀ» ŽÇèÇÑ´Ù.ù°°¡ µ¿½Ã Á¦¾î ¾øÀÌ ¹ß»ýÇÏ´Â °ÍÀÌ´Ù.µÎ ¹øÂ°°¡ Àá±â°í ÀÖ´Â ¸ðµ¨À» »ç¿ëÇϸ鼭 ¹ß»ýÇÏ´Â °ÍÀÌ´Ù.¼¼¹øÂ°´Â versioningÀ» °¡Áö°í ¹ß»ýÇÏ´Â °ÍÀÌ´Ù. Consider the case where a husband and wife go to two different ATM¡¯s at the same time to withdraw money from their checking account. With no concurrency control the following sequence of events can occur. ³²Æí°ú ºÎÀÎÀÌ ¶È°°Àº µ·À» ±×µéÀÇ ¾îÄ«¿îÆ®¸¦ üũÇÏ´Â °Í¿¡¼­ »èÁ¦ÇÒ ½Ã°£¿¡ 2 ´Ù¸¥ ºñµ¿±â Àü¼Û¸ðµåÀÇ °Í¿¡ °¡´Â °÷¿¡ ÄÉÀ̽º¸¦ °í·ÁÇØ¶ó.µ¿½Ã Á¦¾î ¾øÀÌ À̺¥Æ®ÀÇ ´ÙÀ½ ½ÃÄö½º´Â ÀϾ ¼ö ÀÖ´Ù. John reads the balance of the account which is $1,000.. Á¸Àº $1,000.ÀÎ °èÁ¤ Àܾ×À» Àд´Ù. Jane reads the balance of the account which is still $1,000. Á¦ÀÎÀº ¾ÆÁ÷µµ $1,000ÀÎ °èÁ¤ Àܾ×À» Àд´Ù. John posts a $700 withdrawal. Á¸Àº $700 öȸ¸¦ ¾Ë¸°´Ù. Jane posts a $500 withdrawal. Á¦ÀÎÀº $500 öȸ¸¦ ¾Ë¸°´Ù. At this point the account balance is -$200 and the bank is not happy. This happened because with no concurrency control mechanism John¡¯s update is lost as far as Jane is concerned. She never sees the change in account balance. Under the locking model: ÀÌ ½ÃÁ¡¿¡¼­ ¾îÄ«¿îÆ® ¹ë·±½º°¡ -$200ÀÌ°í ¹ðÅ©´Â ÇູÇÏÁö ¾Ê´Ù.º´Ç༺ ÄÁÆ®·Ñ ÀåÄ¡¸¦ °¡Áö°í±â ¶§¹®¿¡ À̰ÍÀº Á¦ÀÎÀÌ ¿°·Á½º·¯¿î ÇÑ Á¸ÀÇ ¾÷µ¥ÀÌÆ®°¡ ÀÒ¾î¹ö¸®´Â ¹ß»ýÇÏÁö ¾Ê¾Ò´Ù.°áÄÚ ±×³à´Â ¾îÄ«¿îÆ® ¹ë·±½º¿¡(¼­)üÀÎÁö¸¦ º¸Áö ¾Ê´Â´Ù.Àá±â°í ÀÖ´Â ¸ðµ¨ ¾Æ·¡: John reads the balance of the account causing a read lock. Á¸Àº Àбâ ÀÚ¹°¼è¸¦ ¾ß±âÇϰí ÀÖ´Â °èÁ¤ Àܾ×À» Àд´Ù. Jane reads the balance of the account causing a read lock. Á¦ÀÎÀº Àбâ ÀÚ¹°¼è¸¦ ¾ß±âÇϰí ÀÖ´Â °èÁ¤ Àܾ×À» Àд´Ù. John posts his withdrawal attempting a write lock which fails due to Jane¡¯s read lock. Á¸Àº Á¦ÀÎÀÇ Àбâ ÀÚ¹°¼è ¶§¹®¿¡ ½ÇÆÐÇÏ´Â ±â·Ï ÀÚ¹°¼è¸¦ ½ÃµµÇϰí ÀÖ´Â ±×ÀÇ Ã¶È¸¸¦ ¾Ë¸°´Ù. Jane posts her withdrawal attempting a write lock which fails due to John¡¯s read lock. Á¦ÀÎÀº Á¸ÀÇ Àбâ ÀÚ¹°¼è ¶§¹®¿¡ ½ÇÆÐÇÏ´Â ±â·Ï ÀÚ¹°¼è¸¦ ½ÃµµÇϰí ÀÖ´Â ±×³àÀÇ Ã¶È¸¸¦ ¾Ë¸°´Ù. A deadlock now exists. Hopefully the database software will detect the deadlock and rollback one of the transactions. Áö±Ý ±³Âø»óŰ¡ Á¸ÀçÇÑ´Ù.Hopefully µ¥ÀÌÅͺ£À̽º ¼ÒÇÁÆ®¿þ¾î´Â ±³Âø»óÅÂ¿Í °Å·¡ÀÇ ·Ñ¹éÁ¤Ã¥ Çϳª¸¦ ŽÁöÇÒ °ÍÀÌ´Ù. Under the versioning model: versioning ¸ðµ¨ ¾Æ·¡: John reads the balance of the account. Á¸Àº °èÁ¤ Àܾ×À» Àд´Ù. Jane reads the balance of the account Á¦ÀÎÀº °èÁ¤ Àܾ×À» Àд´Ù. John posts his withdrawal which causes a new version with new balance to be written. Á¸Àº »õ·Î¿î ¹ë·±½º¸¦ °¡Áö°í »õ·Î¿î ¹öÀüÀÌ ¾²À̾î Áö°Ô µÇ´Â ±×ÀÇ Ã¶È¸¸¦ ¾Ë¸°´Ù. Jane posts her withdrawal but is rolled back when the newer version is detected. ´õ »õ·Î¿î ¹öÀüÀ» ŽÁöÇÒ ¶§ Á¦ÀÎ ±×³àÀÇ Ã¶È¸¸¦ ¾Ë¸®Áö¸¸ Ãë¼ÒÇØ Áø´Ù. A different problem occurs if a user rolls back a transaction. ¸¸¾à »ç¿ëÀÚ°¡ °Å·¡¸¦ Ãë¼ÒÇÑ´Ù¸é ´Ù¸¥ ¹®Á¦°¡ ÀϾ´Ù. John withdraws money from the account which updates the balance. Á¸Àº µ·À» ¹ë·±½º¸¦ ¾÷µ¥ÀÌÆ®ÇÏ´Â °èÁ¿¡¼­ »èÁ¦ÇÑ´Ù. Jane reads the balance. Á¦ÀÎÀº ¹ë·±½º¸¦ Àд´Ù. John rolls back his transaction before committing. ¹üÇϱâ Àü¿¡ Á¸Àº ±×ÀÇ °Å·¡¸¦ Ãë¼ÒÇÑ´Ù. Jane has now seen the wrong balance. Áö±Ý Á¦ÀÎÀº À߸øµÈ ¹ë·±½º¸¦ º¸¾Ò´Ù. In this case a dependency exists between the two transactions. Jane¡¯s transaction produces the correct results only if John¡¯s transaction commits. This illustrates the danger of reading uncommitted data and shows why most databases do not allow dirty read transaction isolation. Using locking the following occurs. ÀÌ °æ¿ì¿¡´Â ÀÇÁ¸ »óŰ¡ 2 °Å·¡ »çÀÌ¿¡(¼­)Á¸ÀçÇÑ´Ù.Á¸ÀÇ °Å·¡°¡ ¹üÇÒ °æ¿ì¿¡¸¸ Á¦ÀÎÀÇ °Å·¡´Â ¿ÇÀº °á°ú¸¦ º¸¿© ÁØ´Ù.À̰ÍÀÌ ÀúÁö¸£Áö ¾ÊÀº µ¥ÀÌÅ͸¦ Àд À§ÇèÀ» ¼³¸íÇÏ°í °í¸³ ¿Ö ´ëºÎºÐÀÇ µ¥ÀÌÅͺ£À̽º°¡ ´õ·¯¿î Àб⠰ŷ¡¸¦ Çã¶ôÇÏÁö ¾Ê´Â °ÍÀ» º¸ÀδÙ.ÁöÁöÀÚ¸¦ Àá±×´Â °ÍÀÌ ÀϾ´Â »ç¿ëÇϱâ. John reads the balance which places a read lock. Á¸Àº Àбâ ÀÚ¹°¼è¸¦ µÎ´Â ¹ë·±½º¸¦ Àд´Ù. John commits his withdrawal which places a write lock during the update. Á¸Àº ¾÷µ¥ÀÌÆ® µ¿¾È ±â·Ï ÀÚ¹°¼è¸¦ µÎ´Â ±×ÀÇ Ã¶È¸¸¦ ¹üÇÑ´Ù. Jane reads the balance which attempts a read lock but must wait due to John¡¯s write lock. Á¦ÀÎ Àбâ ÀÚ¹°¼è¸¦ ½ÃµµÇÏ´Â ¹ë·±½º¸¦ ÀÐÁö¸¸ Á¸ÀÇ ±â·Ï ÀÚ¹°¼è ¶§¹®¿¡ ±â´Ù·Á¾ß ÇÑ´Ù. John cancels the transaction before committing. This rolls back and releases the write lock. ¹üÇϱâ Àü¿¡ Á¸Àº °Å·¡¸¦ Ãë¼ÒÇÑ´Ù.À̰ÍÀÌ µÚ·Î ±¸¸£°í ±â·Ï ÀÚ¹°¼è¸¦ ¹ßÇ¥ÇÑ´Ù. Jane can now read and get the correct balance. Áö±Ý Á¦ÀÎÀÌ ¿ÇÀº ¹ë·±½º¸¦ ÀÐÀ» ¼ö ÀÖ°í ¾òÀ» ¼ö ÀÖ´Ù. Under versioning: versioning ¾Æ·¡: John withdraws money which updates the balance and creates new uncommitted version. Á¸Àº ¹ë·±½º¸¦ ¾÷µ¥ÀÌÆ®ÇÏ°í »õ·Î¿î ÀúÁö¸£Áö ¾ÊÀº ¹öÀüÀ» ¸¸µå´Â µ·À» ã´Â´Ù. Jane reads the balance. This does not reflect John¡¯s uncommitted withdrawal. Á¦ÀÎÀº ¹ë·±½º¸¦ Àд´Ù.À̰ÍÀº Á¸ÀÇ ÀúÁö¸£Áö ¾ÊÀº öȸ¸¦ ¹Ý¿µÇÏÁö ¾Ê´Â´Ù. John rolls back so the version showing the withdrawal is marked rolled back. Á¸Àº Ãë¼ÒÇÑ´Ù ±×·¡¼­ Ãë¼ÒÇØ Áö´Â öȸ¸¦ º¸À̰í ÀÖ´Â ¹öÀü¿¡ ¸¶Å©¸¦ÇÑ´Ù. This illustrates a performance advantage of versioning since Jane does not have to wait to read the balance. Á¦ÀÎÀÌ ¹ë·±½º¸¦ Àд °Í ±â´Ù·Á¾ß ÇÏÁö ¾ÊÀº ÀÌ·¡·Î À̰ÍÀº versioningÀÇ ÆÛÆ÷¸Õ½º ÀÌÁ¡À» ¼³¸íÇÑ´Ù. The following is a different example but the same scenario as the example of the platinum moving form one warehouse to another earlier in this article. ÁöÁöÀÚ´Â ´Ù¸¥ ¿¹ Çϳª°¡ â°í¿¡ ³Ö´Â ¹é±Ý °¨µ¿ÀûÀÎÀº ÇüÅÂÀÇ ÀÌ ¹°Ç°ÀÇ ´õ À̸£ ´Ù¸¥ Çϳª¿¡ °üÇÑ ¿¹·Î¼­ ±×·¯³ª ¶È°°Àº ½Ã³ª¸®¿ÀÀÌ´Ù. John requests the total of all accounts. Á¸Àº ÀüºÎ ¸ðµç ¾îÄ«¿îÆ®¸¦ ºÎŹÇÑ´Ù. Jane transfers money from savings to checking while John¡¯s transaction is running. Á¸ÀÇ °Å·¡°¡ ´Þ¸®°í ÀÖ´Â µ¿¾È Á¦ÀÎÀº ÀúÃàÀ¸·ÎºÎÅÍ µ·À» üũÇÏ´Â °ÍÀ¸·Î ¿Å±ä´Ù. John gets the wrong total. Á¸Àº À߸øµÈ ÅäÅÐÀ» ¹Þ´Â´Ù. Here the analysis of the data is inconsistent because the state of the data was not preserved throughout the life of the read transaction. Under locking: Àб⠰ŷ¡ÀÇ »ý¸í(»î)À» µÎ·ç °ÅÃÄ µ¥ÀÌÅÍÀÇ ½ºÅ×ÀÌÆ®¸¦ º¸Á¸ÇÏÁö ¾Ê±â ¶§¹®¿¡ ¿©±â µ¥ÀÌÅÍÀÇ ºÐ¼®Àº ¾ù°¥¸°´Ù.Àá±â±â: John requests total of all accounts thereby placing a read lock. Á¸Àº ÀüºÎ ±× ¶§¹®¿¡ Àбâ ÀÚ¹°¼è¸¦ µÎ°í ÀÖ´Â ¸ðµç ¾îÄ«¿îÆ®¸¦ ºÎŹÇÑ´Ù. Jane transfers money but cannot place a write lock to commit the transfer due to John¡¯s read lock. Jane must wait until the read transaction finishes. Á¸ÀÇ Àбâ ÀÚ¹°¼è ¶§¹®¿¡ ÀÌÀüÀ» ¹üÇϱâ À§ÇØ Á¦ÀÎ µ·À» ¿Å±âÁö¸¸ ±â·Ï ÀÚ¹°¼è¸¦ µÑ ¼ö ¾ø´Ù.Á¦ÀÎÀº Àб⠰ŷ¡ ¸¶¹«¸®±îÁö ±â´Ù·Á¾ß ÇÑ´Ù. John gets the right total, releases the read lock and Jane¡¯s transaction proceeds. Á¸Àº ¿ÇÀº ÅäÅÐ,¸±¸®½º¿¡°Ô Àбâ ÀÚ¹°¼è¿Í Á¦ÀÎÀÇ °Å·¡ ¼öÀÍÀ» °¡Á®´Ù ÁØ´Ù. Under versioning: versioning ¾Æ·¡: John requests the total of all of his accounts. Á¸Àº ÀüºÎ ±×ÀÇ ¸ðµç ¾îÄ«¿îÆ®¸¦ ºÎŹÇÑ´Ù. Jane transfers money from savings to checking resulting in new versions which John¡¯s transaction does not see. Á¦ÀÎÀº Á¸ÀÇ °Å·¡°¡ º¸Áö ¾Ê°Ô »õ·Î¿î ¹öÀüÀ¸·Î ³¡³ª¸é¼­ ÀúÃàÀ¸·ÎºÎÅÍ µ·À» üũÇÏ´Â °ÍÀ¸·Î ¿Å±ä´Ù. John gets the right total and Jane¡¯s update is not delayed. Á¸ÀÌ ¿ÇÀº ÅäÅÐÀ» ¹Þ°í Á¦ÀÎÀÇ ¾÷µ¥ÀÌÆ®°¡ ´Ê¾î ÁöÁö ¾Ê´Â´Ù. Another variation of the serializable problem occurs if you need to reread the data in the course of the transaction. For example: ¸¸¾à ´ç½ÅÀÌ °Å·¡ µ¿¾È µ¥ÀÌÅ͸¦ ´Ù½Ã Àоî¾ß ÇÑ´Ù¸é serializable ¹®Á¦ÀÇ ´Ù¸¥ º¯È­´Â ÀϾ´Ù.¿¹¸¦ µé¸é: Query for all rowss meeting certain criteria. ¾î¶² ±âÁØ¿¡°Ô ¸ðµç rowss ¹ÌÆÃ¿¡ ´ëÇØ ¹°¾î¶ó. Another user inserts a new row that meets the criteria. ´Ù¸¥ »ç¿ëÀÚ´Â ±âÁØÀ» ¸¸³ª´Â »õ·Î¿î ÁÙÀ» »ðÀÔÇÑ´Ù. Repeat the query and you will get one additional row. The appearance of this phantom row is not consistent within the transaction. Áú¹®À» ¹Ýº¹ÇÏ¸é ´ç½ÅÀº Çϳª Ãß°¡µÈ ÁÙÀ» ¾òÀ» °ÍÀÌ´Ù.ÀÌ À¯·É ÁÙÀÇ ÃâÇöÀº °Å·¡ ¾È¿¡¼­ ÀϰüµÇÁö ¾Ê´Â´Ù. With a database that uses the locking model the only way to prevent this inconsistency is to read lock the whole table for the duration of the transaction. Thus the sequence of events is: ¹æÇذ¡ µÇ±â À§ÇÑ À¯ÀÏÇÑ ¹æ¹ý Àá±â°í ÀÖ´Â ¸ðµ¨À» »ç¿ëÇÏ´Â µ¥ÀÌÅͺ£À̽º¸¦ °¡Áö°í ÀÌ ºÒÀÏÄ¡´Â ÀÚ¹°¼è °Å·¡ÀÇ Áö¼Ó±â°£¿¡°Ô ¸ðµç Å×À̺íÀ» Àоî ÁÖ´Â °ÍÀÌ´Ù.ÀÌ·¸°Ô À̺¥Æ®ÀÇ ½ÃÄö½º´Â ÀÖ´Ù: Place a read lock on the table. Àбâ ÀÚ¹°¼è¸¦ Å×ÀÌºí¿¡ µÖ¶ó. Query for all records meeting certain criteria. ¾î¶² ±âÁØÀ» ¸¸³ª°í ÀÖ´Â ¸ðµç ±â·ÏÀ» À§ÇÑ Áú¹®. Another user attempts to insert a record but is blocked by the table level read lock. ´Ù¸¥ »ç¿ëÀÚ ±â·ÏÀ» »ðÀÔÇÏ·Á°í ÇÏÁö¸¸ ÀÚ¹°¼è Àоî ÁØ Å×À̺í¿ë ·¹º§¿¡ ÀÇÇÏ¿© ¸·Èù´Ù. Repeat the query and you will get the same results because other users cannot commit changes. Áú¹®À» ¹Ýº¹ÇÏ¸é ´Ù¸¥ »ç¿ëÀÚ°¡ üÀÎÁö¸¦ ¹üÇÒ ¼ö ¾ø±â ¶§¹®¿¡ ´ç½ÅÀº ¶È°°Àº °á°ú¸¦ ¾òÀ» °ÍÀÌ´Ù. Under versioning there is no problem because the newly inserted record has a higher transaction number than the read transaction and so it is ignored on the second and subsequent reads that are part of the same transaction. »õ·Î ³¢¿î ±â·ÏÀÌ µÎ ¹øÂ° ´ÙÀ½ Àбâ À§¿¡¼­ °Å·¡ Å« ¼ö¸¦ °¡Áö°í ÀÖ Àб⠰ŷ¡º¸´Ù ±×·¡¼­ ±×°ÍÀÌ ¹«½Ã ´çÇѴٱ⠶§¹®¿¡ ¶È°°Àº °Å·¡ÀÇ ºÎºÐÀÎ ¹®Á¦´Â ±× °÷ versioning ¾Æ·¡ ¾ø´Ù. So far it looks like the versioning model handles most concurrency conflicts better than the locking model. However, this is not always the case. Consider the following case where John and Jane are both told to make their salaries equal. ³Ê¹« far ±×°ÍÀº versioning ¸ðµ¨ÀÌ Àá±â°í ÀÖ´Â ¸ðµ¨º¸´Ù ´õ ³´ ´ëºÎºÐÀÇ º´Ç༺ ´ë¸³À» ´Ù·é °Íó·³ º»´Ù.±×·¯³ª À̰ÍÀº ¾ðÁ¦³ª ÄÉÀ̽º°¡ ¾Æ´Ñ °ÍÀº ¾Æ´Ï´Ù.µÑ ´Ù Á¸°ú Á¦ÀÎÀÌ ±×µéÀÇ ºÀ±ÞÀ» µ¿µîÇÏ°Ô ¸¸µå´Â °ÍÀ» µéÀº °÷¿¡ ´ÙÀ½ ÄÉÀ̽º¸¦ °í·ÁÇØ¶ó. John reads John¡¯s salary. Á¸Àº Á¸ÀÇ ºÀ±Þ¿¡°Ô Àоî ÁØ´Ù. Jane reads Jane¡¯s salary. Á¦ÀÎÀº Á¦ÀÎÀÇ ºÀ±Þ¿¡°Ô Àоî ÁØ´Ù. John sets Jane¡¯s salary equal to John¡¯s. Á¸Àº Á¦ÀÎÀÇ ºÀ±Þ µ¿¹è¸¦ Á¸ÀÇ °Í¿¡ °®´Ù´í´Ù. Jane sets John¡¯s salary equal to Jane¡¯s. Á¦ÀÎÀº Á¸ÀÇ ºÀ±Þ µ¿¹è¸¦ Á¦ÀÎÀÇ °Í¿¡ °®´Ù´í´Ù. The result is that John¡¯s and Jane¡¯s salaries are swapped. Using locking you can prevent this by locking both records. °á°ú´Â Á¸ÀÇ °Í°ú Á¦ÀÎÀÇ ºÀ±ÞÀÌ ¹Ù²Ù¾î Áö´Â °ÍÀÌ´Ù.´ç½ÅÀ» Àá±×´Â °ÍÀÌ µÑ ´Ù ±â·ÏÀ» Àá±ÝÀ¸·Î½á À̰ÍÀ» ¸·À» ¼ö ÀÖ´Â »ç¿ëÇϱâ. John reads his salary and places a read lock. Á¸Àº ±×ÀÇ ºÀ±Þ°ú Àå¼Ò¿¡°Ô Àбâ ÀÚ¹°¼è¸¦ Àоî ÁØ´Ù. Jane reads her salary and places a read lock. Á¦ÀÎÀº ±×³àÀÇ ºÀ±Þ°ú Àå¼Ò¿¡°Ô Àбâ ÀÚ¹°¼è¸¦ Àоî ÁØ´Ù. John sets Jane¡¯s salary equal to his own but cannot commit due to Jane¡¯s read lock. Á¸ Á¦ÀÎÀÇ ºÀ±Þ µ¿¹è¸¦ ±×ÀÇ °Í¿¡ °®´Ù´ëÁö¸¸ Á¦ÀÎÀÇ Àбâ ÀÚ¹°¼è ¶§¹®¿¡ ¹üÇÒ ¼ö ¾ø´Ù. Jane sets John¡¯s salary equal to her own but cannot commit due to John¡¯s read lock. Á¦ÀÎ Á¸ÀÇ ºÀ±Þ µ¿¹è¸¦ ±×³àÀÇ °Í¿¡ °®´Ù´ëÁö¸¸ Á¸ÀÇ Àбâ ÀÚ¹°¼è ¶§¹®¿¡ ¹üÇÒ ¼ö ¾ø´Ù. Once again you have a deadlock which the database system should resolve by rolling one transaction back. Another solution, using locking, is to write lock the entire table as in the following scenario. Çѹø ´õ ´ç½ÅÀº µ¥ÀÌÅͺ£À̽º ½Ã½ºÅÛÀÌ °áÁ¤ÇØ¾ß ÇÏ´Â ±³Âø»óÅ Çϳª °Å·¡¸¦ Ãë¼ÒÇÔÀ¸·Î½áÀ» °¡Áö°í ÀÖ´Ù.´ÙÀ½ ½Ã³ª¸®¿À¿¡(¼­)ÀÏ ¶§ ÀÚ¹°¼è¿¡°Ô Àüü Å×À̺íÀ» ½áº¸³»±â À§ÇØ Àá±â°í ´Ù¸¥ ¼Ö·ç¼Ç »ç¿ëÇϱâ. John write locks the table. Á¸ ±â·ÏÀº Å×À̺íÀ» Àá±Ù´Ù. John reads his salary. Á¸Àº ±×ÀÇ ºÀ±ÞÀ» Àд´Ù. Jane tries to read her salary but is blocked by John¡¯s table level write lock. ÀÚ¹°¼è¸¦ ½á¶ó Á¦ÀÎ ±×³àÀÇ ºÀ±ÞÀ» ÀÐÀ¸·Á°í ³ë·ÂÇÏÁö¸¸ Á¸ÀÇ Å×À̺í¿ë ·¹º§¿¡ ÀÇÇÏ¿© ¸·Èù´Ù. John sets Jane¡¯s salary equal to his own and releases the write lock. Á¸ÀÌ Á¦ÀÎÀÇ ºÀ±Þ µ¿¹è¸¦ ±×ÀÇ °Í¿¡ °®´Ù´ë°í ±â·Ï ÀÚ¹°¼è¸¦ ¹ßÇ¥ÇÑ´Ù. Jane¡¯s transaction is now free to proceed. Á¦ÀÎÀÇ °Å·¡´Â Áö±Ý ÀÚÀ¯·Ó°Ô °è¼Ó ³ª¾Æ°¥ ¼ö ÀÖ´Ù. Under versioning: versioning ¾Æ·¡: John reads his own salary. Á¸Àº ±×ÀÇ ÀÚ½ÅÀÇ ºÀ±ÞÀ» Àд´Ù. Jane reads her salary. Á¦ÀÎÀº ±×³àÀÇ ºÀ±ÞÀ» Àд´Ù. John sets Jane¡¯s salary equal to his and commits. Á¸ÀÌ Á¦ÀÎÀÇ ºÀ±Þ µ¿¹è¸¦ ±×ÀÇ °Í¿¡ °®´Ù´ë°í ¹üÇÑ´Ù. Jane sets John¡¯s salary equal to hers and commits. Á¦ÀÎÀÌ Á¸ÀÇ ºÀ±Þ µ¿¹è¸¦ ±×³àÀÇ °Í¿¡ °®´Ù´ë°í ¹üÇÑ´Ù. Since versioning allows both transactions to process concurrently once again the salaries are swapped. The only way to solve this problem with the versioning model is as follows. versioningÀÌ µÎ °Å·¡°¡ µ¿½Ã¿¡ Çѹø ´õ ÁÙÁö¾î °Èµµ·Ï Çã¶ôÇÏ´Â ÀÌ·¡·Î ºÀ±ÞÀÌ ¹Ù²Ù¾î Áø´Ù.versioning ¸ðµ¨À» °¡Áö°í ÀÌ ¹®Á¦¸¦ ÇØ°áÇϱâ À§ÇÑ ¹æ¹ý¸¸Àº ´ÙÀ½°ú °°´Ù. John reads John¡¯s salary. Á¸Àº Á¸ÀÇ ºÀ±Þ¿¡°Ô Àоî ÁØ´Ù. Jane reads Jane¡¯s salary. Á¦ÀÎÀº Á¦ÀÎÀÇ ºÀ±Þ¿¡°Ô Àоî ÁØ´Ù. John sets Jane¡¯s salary equal to John¡¯s. Á¸Àº Á¦ÀÎÀÇ ºÀ±Þ µ¿¹è¸¦ Á¸ÀÇ °Í¿¡ °®´Ù´í´Ù. John sets John¡¯s salary to itself creating a newer version. Á¸Àº Á¸ÀÇ ºÀ±ÞÀ» ±× ÀÚü·Î ´õ »õ·Î¿î ¹öÀüÀ» ¸¸µå´Â °Í¿¡ °®´Ù´í´Ù. Jane sets John¡¯s salary equal to Jane¡¯s but rolls back because a newer version exists. Á¦ÀÎ Á¸ÀÇ ºÀ±Þ µ¿¹è¸¦ Á¦ÀÎÀÇ °Í¿¡ °®´Ù´ëÁö¸¸ ´õ »õ·Î¿î ¹öÀüÀÌ Á¸ÀçÇϱ⠶§¹®¿¡ µÚ·Î ±¸¸¥´Ù. Here the problem is solved by setting John¡¯s salary equal to itself. This forces the creation of a new record version for John¡¯s salary. Since versioning architecture will not allow a change to be committed when a version of the record to be updated exists which was created after the start of the current transaction Jane¡¯s update rolls back. ¿©±â ¹®Á¦°¡ Á¸ÀÇ ºÀ±Þ µ¿¹è¸¦ °®´Ù´ïÀ¸·Î½á ±× ÀÚü·Î ÇØ°áÇØ Áø´Ù.À̰ÍÀº Á¸ÀÇ ºÀ±ÞÀ» À§ÇØ »õ·Î¿î ±â·Ï ¹öÀüÀÇ Ã¢Á¶¸¦ °­¿äÇÑ´Ù.¾÷µ¥ÀÌÆ®µÉ ±â·ÏÀÇ ¹öÀüÀÌ ¾î´À °ÍÀÌ ÇöÀç °Å·¡ÀÇ ½ÃÀÛ ÈÄ¿¡ ¸¸µé¾î Áø Á¸ÀçÇÒ ¶§ versioning °ÇÃàÀÌ Ã¼ÀÎÁö°¡ committedÀ» ÀÎÁ¤ÇÏÁö ¾ÊÀ» °ÍÀÎ ÀÌ·¡·Î Á¦ÀÎÀÇ ¾÷µ¥ÀÌÆ®´Â Ãë¼ÒÇÑ´Ù. Recovery ȸº¹ One very important issue in database applications is recovery time if the server crashes. No matter how robust your hardware and software and how reliable your power supply there is always a possibility that the server will fail. Both locking and versioning databases will recover automatically when the server is restarted but there is a significant difference in the time that recovery will take if many transactions are active at the time of the crash. ¸¸¾à ¼­¹ö°¡ ºÎ¼­Áø´Ù¸é µ¥ÀÌÅͺ£À̽º ÀÀ¿ë ÇÁ·Î±×·¥ÀÇ ¸Å¿ì Áß¿äÇÑ Çϳª À̽´´Â ȸº¹ ½Ã°£ÀÌ´Ù.´ç½ÅÀÇ Çϵå¿þ¾î¿Í ¼ÒÇÁÆ®¿þ¾î ºñ·Ï ¾î¶»°ÔÀÏÁö¶óµµ ¾ó¸¶³ª ¹ÏÀ» ¼ö Àִ ưưÇÏ ±×¸®°í ´ç½ÅÀÇ ±× °÷ ÆÄ¿ö ¼­ÇöóÀÌ´Â ¾ðÁ¦³ª ¼­¹ö°¡ ½ÇÆÐÇÏ´Â °¡´É¼ºÀÌ´Ù.¸¸¾à ¸¹Àº °Å·¡°¡ Ãæµ¹ÀÇ ½Ã°£¿¡ Ȱ¹ßÇÏ´Ù¸é ¼­¹ö°¡ Àç°³µÉ ¶§ Àá°Ü±â,versioning µÑ ´Ù µ¥ÀÌÅͺ£À̽º°¡ ÀÚµ¿ÀûÀ¸·Î ȸº¹ÇÒ °ÍÀÌÁö¸¸ ±× ȸº¹ÀÌ ÃëÇÒ °ÍÀÎ ¸ÓÁö¾Ê¾Æ Áß¿äÇÑ Â÷À̰¡ ÀÖ´Ù. Locking model databases write each transaction to a log file. To recover after a crash the database manager must read the log file and rollback all of the transactions that were active at the time of the crash by copying information from the log to the database. Àá±â°í ÀÖ´Â ¸ðµ¨ µ¥ÀÌÅͺ£À̽º´Â ·Î±× ÆÄÀÏ¿¡°Ô °¢ °Å·¡¸¦ ¾´´Ù.Ãæµ¹ ÈÄ¿¡ µ¥ÀÌÅͺ£À̽º¸¦ µÇã±â À§ÇØ ¸Å´ÏÀú´Â ·Î±× ÆÄÀϰú ·Ñ¹éÁ¤Ã¥¿¡°Ô ·Î±×·ÎºÎÅÍ Á¤º¸¸¦ µ¥ÀÌÅͺ£À̽º·Î º¹»çÇÔÀ¸·Î½á Ãæµ¹ÀÇ ½Ã°£¿¡ Ȱ¹ßÇß´ø ¸ðµç °Å·¡¸¦ Àоî ÁÖ¾î¾ß ÇÑ´Ù. A versioning database does not have a log file. The record versions in the database provide all of the information needed to recover. No data needs to be copied from one place to another. Instead, when the database manager comes back on line it simply scans the transaction inventory pages and changes the status of all active transactions to rolled back. This will take at most a few seconds even with a large number of active transactions. Crash recovery is another area where the versioning model excels. versioning µ¥ÀÌÅͺ£À̽º°¡ ·Î±× ÆÄÀÏÀ» °¡Áö°í ÀÖÁö ¾Ê´Ù.µ¥ÀÌÅͺ£À̽ºÀÇ ±â·Ï ¹öÀüÀº ȸº¹ÇÏ´Â °ÍÀÌ ÇÊ¿äÇÑ ¸ðµç Á¤º¸¸¦ Á¦°øÇÑ´Ù.µ¥ÀÌÅÍ´Â Çϳª Àå¼Ò·ÎºÎÅÍ ´Ù¸¥ Çϳª·Î º¹»çÇØ Á®¾ß ÇÏÁö ¾Ê´Â´Ù.µ¥ÀÌÅͺ£À̽º ¸Å´ÏÀú°¡ µÚ·Î ¶óÀÎ À§¿¡¼­ ¿Ã ¶§ ±× ´ë½Å °£´ÜÈ÷ ±×°ÍÀÌ °Å·¡ ǰ¸ñÀ϶÷ ÆäÀÌÁö¸¦ ÈȾ°í ¼ö¸¹Àº Ȱ¹ßÇÑ °Å·¡ °¡¿îµ¥¿¡¼­ ½ºÅ×ÀÌÅͽº¸¦ µ¹µ¹ ¸¸ ¹éÀ¸·Î¹Ù²Û´Ù.À̰ÍÀº Ȱ¹ßÇÑ ¸¹Àº °Å·¡¸¦ °¡Áö°í µ¿µîÇÏ ±â²¯ÇØ¾ß ¼öÃÊ ÃëÇÒ °ÍÀÌ´Ù.versioning ¸ðµ¨ÀÌ ¶Ù¾î³­ °÷¿¡ Ãæµ¹ ȸº¹Àº ´Ù¸¥ Áö¿ªÀÌ´Ù. What happens if the one of the disk drives hosting the database has a mechanical failure? With locking model databases you can usually place the log file on a different device and log all transactions since the last database backup. If a physical drive failure occurs you can restore from the last backup and reprocess the log file to recover the database. With a versioning database the only protection against a drive failure is to mirror the database. You can use Interbase¡¯s built in shadowing to accomplish this, use RAID drives or use mirroring at the operating system level. ¸¸¾à µ¥ÀÌÅͺ£À̽º¸¦ ÁÖÃÖÇϰí ÀÖ´Â µð½ºÅ© µå¶óÀ̺ê ÁßÀÇ Çϳª°¡ ±â°èÀûÀÎ ½ÇÆÐ¸¦ °¡Áö°í ÀÖ´Ù¸é ¹«¾ùÀÌ ¹ß»ýÇմϱî?º¸ÅëÀº ´ç½ÅÀº ´Ù¸¥ ÀåÄ¡¿Í ¸¶Áö¸· µ¥ÀÌÅͺ£À̽º ÀÌÈÄ ¸ðµç °Å·¡ backup ·Î±× À§ÀÇ ·Î±× ÆÄÀÏÀ» ¸ðµ¨ µ¥ÀÌÅͺ£À̽º¸¦ Àá±×´Â °Í¿¡ Á¦ÃâÇÒ ¼ö ÀÖ´Ù.¸¸¾à À°Ã¼Àû µå¶óÀÌºê ½ÇÆÐ°¡ ÀϾ´Ù¸é ´ç½ÅÀÌ ¸¶Áö¸· ¹é¾÷À¸·ÎºÎÅÍ È¸º¹ÇÒ ¼ö ÀÖ°í µ¥ÀÌÅͺ£À̽º¸¦ µÇã±â À§ÇØ ·Î±× ÆÄÀÏÀ» Àç°¡°ø ÇÒ ¼ö ÀÖ´Ù.versioning µ¥ÀÌÅͺ£À̽º¸¦ °¡Áö°í µå¶óÀÌºê ½ÇÆÐ·ÎºÎÅÍÀÇ º¸È£¸¸Àº µ¥ÀÌÅͺ£À̽º¸¦ ¹Ý¿µÇÏ´Â °ÍÀÌ´Ù.´ç½Å ĵ Interbase »ç¿ëÀº À̰ÍÀ» ¼ºÃëÇϱâ À§ÇØ ±Þ½À µå¶óÀ̺곪 »ç¿ëÀ» »ç¿ëÇØ¶ó ÀÏÇϰí ÀÖ´Â ½Ã½ºÅÛ ·¹º§¿¡(¼­)°ÇÃà¾÷¿¡ Á¾»çÇÏ´Â ±×´Ã Áö°Ô ÇÏ´Â ¹Ý¿µÇÏ °¡Áö°í ÀÖ´Ù. Expanding the Database µ¥ÀÌÅͺ£À̽º¸¦ ´Ã¸®±â While some databases require you to shutdown the database to increase the size of the log file and to unload and reload the data to increase the size of the database Interbase does not. Interbase databases expand automatically up to the maximum size allowed by the file system as more data is added. If the database is approaching the maximum size allowed by the operating system more space can be made available by adding a secondary file using the ALTER DATABASE command. While ALTER DATABASE requires exclusive use of the database it is very fast since it does not require the data to be dumped and reloaded. ·Î±× ÆÄÀÏÀÇ »çÀÌÁ Áõ°¡½Ã۱â À§ÇØ ´ç½ÅÀÌ µ¥ÀÌÅͺ£À̽º¸¦ Æó¼âÇÏ´Â °Í ¸î¸îÀÇ µ¥ÀÌÅͺ£À̽º°¡ µ¥ÀÌÅ͸¦ ³»¸®°í µ¥ÀÌÅͺ£À̽ºÀÇ »çÀÌÁ Áõ°¡½Ã۱â À§ÇØ ´Ù½Ã ½ÇÀ¸¶ó°í ¿ä±¸ÇÏ´Â µ¿¾È InterbaseÀº ÇÏÁö ¾Ê´Â´Ù.Interbase µ¥ÀÌÅͺ£À̽º´Â ´õ ¸¹Àº µ¥ÀÌÅ͸¦ ´õÇÒ ¶§ ÆÄÀÏ ½Ã½ºÅÛ¿¡ ÀÇÇÏ¿© Çã¶ôµÈ ÃÖ°í »çÀÌÁî±îÁö ÀÚµ¿ÀûÀ¸·Î ÆØÃ¢ÇÑ´Ù.¸¸¾à µ¥ÀÌÅͺ£À̽º°¡ ¿î¿µ üÁ¦¿¡ ÀÇÇÏ¿© Çã¶ôµÈ ÃÖ°í »çÀÌÁî¿¡°Ô Á¢±ÙÇϰí ÀÖ´Â´Ù¸é ´õ ¸¹Àº ½ºÆäÀ̽º°¡ 2Â÷Àº ÆÄÀÏÀ» ´õÇÔÀ¸·Î½á µ¥ÀÌÅͺ£À̽º ¸í·ÉÀ» ¹Ù²Ù¾î¶ó »ç¿ëÇÏ´Â »ç¿ë°¡´ÉÇÏ°Ô ¸¸µé¾î Áú ¼ö ÀÖ´Ù.±×°ÍÀÌ µ¥ÀÌÅÍ¿¡°Ô ¶³¾îÁö°í ´Ù½Ã ½Ç¾î Áö¶ó°í ¿ä±¸ÇÏÁö ¾Ê´Â ÀÌ·¡·Î µ¥ÀÌÅͺ£À̽º°¡ ±×°ÍÀÌ ÀÖ´Â µ¥ÀÌÅͺ£À̽ºÀÇ ¹èŸÀûÀÎ »ç¿ëÀ» ¸Å¿ì »¡¸® ÇÊ¿ä·Î ÇÏ°Ô ¹Ù²î¾î¶ó WhileÀ̾î¶ó. Other Issues ´Ù¸¥ À̽´ At first it might appear that a versioning database has a significant disadvantage because the multiple record versions will cause the database size to increase rapidly compared to a locking database. While that is true do not forget that other databases grow also as their log files expand. óÀ½¿¡´Â ´ÙÁß ±â·Ï ¹öÀüÀ¸·Î µ¥ÀÌÅͺ£À̽º »çÀÌÁî°¡ Àá±â°í ÀÖ´Â µ¥ÀÌÅͺ£À̽º¿¡ »¡¸® ºñÀ¯µÇ¾î¼­ ´Ã°Ô µÉ °ÍÀ̱⠶§¹®¿¡ versioning µ¥ÀÌÅͺ£À̽º°¡ Áß¿äÇÑ ºÒÀÌÀÍÀ» °¡Áö°í ÀÖ´Â °Íó·³ º¸ÀÏ ¼ö ÀÖ´Ù.±×°ÍÀÌ »ç½ÇÀÎ µ¿¾È ±×µéÀÇ ·Î±× ÆÄÀÏÀÌ ÆØÃ¢ÇÒ ¶§ ´Ù¸¥ µ¥ÀÌÅͺ£À̽º°¡ ¶ÇÇÑ ÀÚ¶ó´Â °ÍÀ» ÀØÁö ¸»¾Æ¶ó. However, versioning databases will certainly grow rapidly if something is not done to control the proliferation of record versions. The database manager performs some of the housekeeping for you automatically. Each time a record is accessed the database manager checks to see if any of the prior versions of that record are no longer needed. A version is no longer needed if its transaction rolled back or if there is a later committed version of the record and there are no active transactions with a transaction number less than the transaction number of the newer committed version. Versions that are no longer needed are automatically deleted and the space they occupied in the database pages is reused. ¸¸¾à ±â·Ï ¹öÀüÀÇ È®»êÀ» ÄÁÆ®·ÑÇϱâ À§ÇØ ¹º°¡¸¦ ÇÏÁö ¾Ê´Â´Ù¸é ±×·¯³ª ¹°·Ð versioning µ¥ÀÌÅͺ£À̽º´Â »¡¸® ÀÚ¶ö °ÍÀÌ´Ù.µ¥ÀÌÅͺ£À̽º ¸Å´ÏÀú´Â ´ç½ÅÀ» À§ÇØ ÀÚµ¿ÀûÀ¸·Î »ì¸²»ìÀÌ ÁßÀÇ ÀϺθ¦ ÇàÇÑ´Ù.±â·Ï¿¡ Á¢±ÙÇÒ ¶§¸¶´Ù µ¥ÀÌÅͺ£À̽º ¸Å´ÏÀú´Â ¸¸¾à ´õ ÀÌ»ó ±× ±â·ÏÀÇ ÀüÀÇ ¹öÀü ¸ðµÎ°¡ ÇÊ¿äÇÏÁö ¾Ê´Ù¸éÀ» º¸´Â °Í üũÇÑ´Ù.¸¸¾à ±×°ÍÀÇ °Å·¡°¡ Ãë¼ÒÇß´Ù¸é ¸¸¾à ±â·ÏÀÇ ´õ ÃֽŠcommitted ¹öÀüÀÌ ÀÖ´Â´Ù¸é ´õ ÀÌ»ó ¹öÀüÀÌ ÇÊ¿äÇÏÁö ¾Ê°í ´õ »õ·Î¿î committed ¹öÀüÀÇ °Å·¡ ¼ýÀÚ°¡ ¸ø µÇ´Â °Å·¡ ¼ýÀÚ¸¦ °¡Áö°í Ȱ¹ßÇÑ °Å·¡°¡ ¾ø´Ù.ÀÚµ¿ÀûÀ¸·Î ´õ ÀÌ»ó ÇÊ¿äÇÏÁö ¾ÊÀº ¹öÀüÀ» Áö¿ì°í ±×µéÀÌ µ¥ÀÌÅͺ£À̽º ÆäÀÌÁö¿¡(¼­)Â÷ÁöÇÑ ½ºÆäÀ̽º°¡ ´Ù½Ã »ç¿ëµÈ´Ù. Many rows in many databases are visited infrequently. To remove unneeded versions of these rows the database must be swept periodically. A sweep operation visits every row in every table in the database and deletes outdated versions. You can run the sweep while the database is in use but the sweep will impact performance while it is running. ¸¹Àº µ¥ÀÌÅͺ£À̽ºÀÇ ¸¹Àº ÁÙÀÌ µå¹°°Ô ¹æ¹®ÇØ Áø´Ù.ÀÌ ÁÙÀÇ unneeded ¹öÀüÀ» Á¦°ÅÇϱâ À§ÇØ µ¥ÀÌÅͺ£À̽º´Â Á¤±âÀûÀ¸·Î µÚÂÊÀ¸·Î ±â¿ò¿¡ Ʋ¸² ¾ø´Ù.¾µ±â ÀÛµ¿ÀÌ µ¥ÀÌÅͺ£À̽ºÀÇ ¸ðµç Å×À̺íÀÇ ¸ðµç ÁÙÀ» ¹æ¹®ÇÏ°í ½Ã´ë¿¡ µÚÁø ¹öÀüÀ» Áö¿î´Ù.±×°ÍÀÌ ´Þ¸®°í ÀÖ´Â µ¿¾È µ¥ÀÌÅͺ£À̽º°¡ »ç¿ëÁßÀÌÁö¸¸ ¾µ±â°¡ ÆÛÆ÷¸Õ½º¿¡ Ãæ°ÝÀ» ÁÙ °ÍÀÎ µ¿¾È ´ç½ÅÀº ¾µ±â¸¦ ´Þ¸± ¼ö ÀÖ´Ù. Interbase, by default, will automatically start a sweep after 20,000 transactions. That is not the best way to manage sweeping because you have no control over when the sweep will start and the user that starts the transaction that triggers the sweep is locked until the sweep finishes. It is better to manually start a sweep periodically at a time when database usage is low. Transaction performance is also improved by a sweep performed when no one else is using the database or by a backup and restore. This is because Interbase will not remove record versions older than the Oldest Interesting Transaction (OIT). The OIT is the oldest transaction whose state is something other than committed. The state of all transactions since the OIT is maintained in the TIP and the record versions for these transactions are retained in the database. Performing a sweep when you have exclusive use of the database or performing a backup and restore will reset the OIT to the last committed transaction and remove all prior transactions from the TIP and remove their versions from the database. This not only frees the maximum amount of space in the database but also reduces the size of the TIP. Since the TIP must be copied for each transaction when it starts making the TIP smaller means that transactions will start faster. ºÎÀçÁßÀÇ ÀÚµ¿ÀûÀ¸·Î InterbaseÀº 20,000 °Å·¡ ÈÄ¿¡ ¾µ±â¸¦ ½ÃÀÛÇÒ °ÍÀÌ´Ù.¾µ±â°¡ ½ÃÀÛµÉ °ÍÀÏ ¶§ ´ç½ÅÀÌ ¾µ±â ¸¶¹«¸® ¾ïÁ¦ ¼ö´ÜÀ» ÇÏÁö ¾Ê°í ¾µ±â¸¦ ÀÏÀ¸Å°´Â °Å·¡¸¦ ½ÃÀÛÇÏ´Â »ç¿ëÀÚ°¡ Àá±â±â ¶§¹®¿¡ ±×°ÍÀº û¼Ò¸¦ °ü¸®ÇÏ´Â °¡Àå ÁÁÀº ¹æ¹ýÀÌ ¾Æ´Ï´Ù.µ¥ÀÌÅͺ£À̽º »ç¿ëÀÌ ³·À» ¶§ Çѹø¿¡ ¼ÕÀ¸·Î Á¤±âÀûÀ¸·Î ¾µ±â¸¦ ½ÃÀÛÇÏ´Â °ÍÀº ´õ ÁÁ´Ù.¶ÇÇÑ °Å·¡ ÆÛÆ÷¸Õ½º°¡ ±× ¹Û¿¡ ¾Æ¹«µµ µ¥ÀÌÅͺ£À̽º¸¦ »ç¿ëÇÏÁö ¾Ê°í ÀÖÀ» ¶§ ÇàÇÑ ¾µ±â¿¡ ÀÇÇÏ¿© ¶Ç´Â ±×¸®°í º¹±¸Çضó ¹é¾÷¿¡ ÀÇÇÏ¿© Çâ»óµÈ´Ù.À̰ÍÀº InterbaseÀÌ °¡Àå ¿À·¡µÈ Àç¹Ì ÀÖ´Â °Å·¡(OIT)º¸´Ù ´õ ¿À·¡µÇ´Â ±â·Ï ¹öÀüÀ» Á¦°ÅÇÏÁö ¾ÊÀ» °ÍÀ̱⠶§¹®ÀÌ´Ù.OIT °¡Àå ¿À·¡µÈ °Å·¡´Â ¹üÇÏ¿©¼­ ´©±¸ÀÇ ½ºÅ×ÀÌÆ® ¹º°¡°¡ ´Þ¶óÀÌ ÀÖ½À´Ï±î.¼ö¸¹Àº OIT ÀÌÈÄ °Å·¡ °¡¿îµ¥¿¡¼­ ½ºÅ×ÀÌÆ®°¡ ÆÁ¿¡(¼­)À¯ÁöµÇ°í ÀÌ °Å·¡¸¦À§ÇÑ ±â·Ï ¹öÀüÀÌ µ¥ÀÌÅͺ£À̽º¿¡(¼­)°è¼Ó À¯ÁöµÈ´Ù.´ç½ÅÀÌ ¹èŸÀûÀÎ µ¥ÀÌÅͺ£À̽ºÀÇ »ç¿ë ¹é¾÷À» ÇàÇÏ´Â °ÍÀ» °¡Áö°í ÀÖ°í º¹±¸ÇÒ ¶§ ¾µ±â¸¦ ÇàÇÏ´Â °ÍÀÌ OITÀ» ´Ù½Ã ¸¶Áö¸· committed °Å·¡·Î ÇâÇÏ°Ô ÇÒ °ÍÀÌ°í ÆÁ¿¡¼­ ¸ðµç ÀüÀÇ °Å·¡¸¦ Á¦°ÅÇÒ °ÍÀÌ°í µ¥ÀÌÅͺ£À̽º¿¡¼­ ±×µéÀÇ ¹öÀüÀ» Á¦°ÅÇÒ °ÍÀÌ´Ù.ÀÌ°Í ´ÜÁö µ¥ÀÌÅͺ£À̽ºÀÇ ÃÖ°í »ó´ç·®ÀÇ ½ºÆäÀ̽º¸¦ ÀÚÀ¯·Ó°Ô ÇØ ÁÖÁö ¾ÊÁö¸¸ ¶ÇÇÑ ÆÁÀÇ »çÀÌÁ ÁÙÀδÙ.±×°ÍÀÌ ½ÃÀÛµÉ ¶§ ÆÁÀÌ °¢ °Å·¡¸¦ À§ÇØ Ä«ÇǵǾî¾ß ÇÏ´Â ÀÌ·¡·Î ÆÁÀ» ´õ ÀÛ°Ô ¸¸µå´Â °ÍÀº °Å·¡°¡ ´õ »¡¸® ½ÃÀÛµÉ °ÍÀ» ÀǹÌÇÑ´Ù. Interbase has a very small footprint requiring less than 10 megabytes of disk space and is very easy to install and configure. There are only two parameters you need to set. The first is the page size of the database and the second is the cache size in pages. Once these parameters are set Interbase tunes itself to provide optimum performance. Easy installation and maintenance make Interbase a good choice for installations where there is no database administrator. Finally, Interbase runs on a wide variety of platforms which makes it easily scalable to handle changing needs. InterbaseÀÌ ¸Å¿ì ÀÛÀº ¹ßÀÚ±¹ µð½ºÅ© °ø°£ÀÇ ¹Ì¸¸ ¸Þ°¡¹ÙÀÌÆ® 10 °³À» ÇÊ¿ä·Î ÇÏ´Â °ÍÀ» °¡Áö°í ÀÖ°í ¼³Ä¡ÇÏ°í ¸¸µé±â¿¡ ¸Å¿ì ½±´Ù.´ç½ÅÀÌ ³õ¾Æ¾ß ÇÏ´Â ÆÄ¶ó¹ÌÅÍ 2 Æí¸¸ÀÌ ÀÖ´Ù.ù°°¡ µ¥ÀÌÅͺ£À̽ºÀÇ ÆäÀÌÁö »çÀÌÁîÀÌ°í µÎ ¹øÂ°´Â ÆäÀÌÁöÀÇ Àº´Ðó »çÀÌÁîÀÌ´Ù.ÀÏ´Ü ÀÌ ÆÄ¶ó¹ÌÅͰ¡ ³õ¾Æ Áö¸é InterbaseÀº ÃÖÀûÀÎ ÆÛÆ÷¸Õ½º¸¦ Á¦°øÇÏ´Â °Í ±× ÀÚü¸¦ Á¶È­½ÃŲ´Ù.µ¥ÀÌÅͺ£À̽º °ü¸®ÀÚ°¡ ¾ø´Â °÷¿¡ ½¬¿î ¼³Ä¡¿Í À¯Áöº¸¼ö´Â ¼³ºñ¸¦ À§ÇØ InterbaseÀ» ÁÁÀº ¼±ÅÃÀ¸·Î ¸¸µç´Ù.¸¶Ä§³» InterbaseÀº º¯Çϰí ÀÖ´Â ÇÊ¿äÇÑ °ÍÀ» ´Ù·ç´Â °ÍÀ» ½±°Ô Àú¿ï·Î ´Þ ¼ö ÀÖ°Ô ÇÏ´Â ³ÐÀº ´Ù¾çÇÑ Ç÷§Æû À§¿¡¼­ ´Þ¸°´Ù. Interbase also supports multiple character sets per table making it an ideal choice for international applications. Interbase pioneered efficient storage of BLOB data and supports multiple BLOB fields per database as well as updateable views. ¶ÇÇÑ InterbaseÀº ±¹Á¦ÀûÀÎ ÀÀ¿ë ÇÁ·Î±×·¥À» À§ÇØ ±×°ÍÀ» ÀÌ»óÀûÀÎ ¼±ÅÃÀ¸·Î ¸¸µé°í ÀÖ´Â Å×À̺í´ç ´ÙÁß ¹®ÀÚ ¼¼Æ®¸¦ ÁöÁöÇÑ´Ù.InterbaseÀÌ ¾ó·è µ¥ÀÌÅÍÀÇ ´É·üÀûÀÎ ÀúÀåÀ» °³Ã´Çß°í updateable ºä »Ó¸¸ ¾Æ´Ï¶ó µ¥ÀÌÅͺ£À̽º´ç ´ÙÁß ¾ó·è Çʵ带 ÁöÁöÇÑ´Ù. Conclusion °á¸» Selecting the right database for your application requires a clear understanding of the types of transactions the system will have to process. Many applications today include a mixture of multi-row read transactions and updates. In this environment versioning has a clear advantage because it can process read and write transactions concurrently while still providing serializable isolation to ensure accuracy. Versioning also provides very rapid crash recovery since there is no log file to process. When a versioning database restarts it simply marks all open but uncommitted transactions as rolled back and is ready to go. ´ç½ÅÀÇ ÀÀ¿ëÀ» À§ÇÑ ¿ÇÀº µ¥ÀÌÅͺ£À̽º¸¦ ¼±ÅÃÇÏ´Â °ÍÀº À¯ÇüÀÇ ½Ã½ºÅÛÀÌ Ã³¸®ÇØ¾ß ÇÒ °ÍÀÎ °Å·¡ÀÇ ¸íÈ®ÇÑ ÀÌÇØ¸¦ ÇÊ¿ä·Î ÇÑ´Ù.¸¹Àº ¿À´Ã ÀÀ¿ë ÇÁ·Î±×·¥Àº multi-row Àб⠰ŷ¡¿Í ¾÷µ¥ÀÌÆ®ÀÇ È¥ÇÕÀ» Æ÷ÇÔÇÑ´Ù.±×°ÍÀÌ ÁÙÁö¾î °ÉÀ» ¼ö Àֱ⠶§¹®¿¡ ¾ÆÁ÷µµ Á¤È®¼ºÀ» È®½ÇÇÏ°Ô Çϱâ À§ÇØ serializable °í¸³À» Á¦°øÇÏ´Â µ¿¾È ÀÌ È¯°æ¿¡(¼­)versioningÀº ¸íÈ®ÇÑ ÀÌÁ¡ÀÌ °Å·¡¸¦ ÀÐ°í µ¿½Ã¿¡ ¾²°Ô ÇÑ´Ù.·Î±× ÆÄÀÏÀÌ ¾ø´Â ÀÌ·¡·Î ¶ÇÇÑ VersioningÀº ÁÙÁö¾î °È±â À§ÇØ ¸Å¿ì ºü¸¥ Ãæµ¹ ȸº¹À» Á¦°øÇÑ´Ù.versioning µ¥ÀÌÅͺ£À̽º°¡ Àç°³ÇÒ ¶§ Ãë¼ÒÇß°í °¥ Áغñ°¡ µÇ¾î ÀÖÀ» ¶§ °£´ÜÈ÷ ±×°ÍÀº ¿­·Á ÀÖÁö¸¸ ÀúÁö¸£Áö ¾Ê ¸ðµç °Å·¡¿¡ ÀÚ±¹À» ³½´Ù. At this writing Inprise¡¯s Interbase is both the newest of the major database servers and the only one to use the versioning model. In addition to the advantages of the versioning model Interbase has the smallest disk and memory footprint (it ships on two diskettes), is self tuning and runs on Netware, Windows NT and a wide variety of Unix platforms so it is highly scalable. ÀÌ ±Û¿¡(¼­)InpriseÀÇ InterbaseÀº ÁÖ¿äÇÑ µ¥ÀÌÅͺ£À̽º ¼­¹ö Áß¿¡ °¡Àå »õ·Î¿î versioning ¸ðµ¨À» »ç¿ëÇÒ À¯ÀÏÇÑ Çϳª µÑ ´ÙÀÌ´Ù.versioning ¸ðµ¨ÀÇ ÀÌÁ¡ ¿Ü¿¡ InterbaseÀÌ µð½ºÅ©¿Í ¸Þ¸ð¸® °¡Àå ÀÛÀº ¹ßÀÚ±¹À» °¡Áö°í ÀÖ°í(±×°ÍÀÌ µð½ºÄÏ 2 ÀÚ·ç À§¿¡¼­ ¹è¸¦ Ÿ´Â °Í)ÀÌ´Ù.ÀÚ±â Æ©´×°ú ·±Àº Netware¿Í Windows NT¿Í ³ÐÀº ´Ù¾çÇÑ Unix Ç÷§Æû À§¿¡¼­ ÀÖ´Ù ±×·¡¼­ ±×°ÍÀÌ Àú¿ï·Î ´Þ ¼ö ÀÖ ´ë´ÜÈ÷ÀÌ´Ù. -------------------------------------------------------------------------------- Add or View comments on this article ÀÌ ¹°Ç° À§ÀÇ ÄÚ¸àÆ®¸¦ ´õÇÏ¿©¶ó ±×·¸Áö ¾ÊÀ¸¸é º¸¾Æ¶ó Products: Products: InterBase 3.x, InterBase 4.x, InterBase 5.0, InterBase 5.1, InterBase 5.2, InterBase 5.5, InterBase 5.6, InterBase 6.0 InterBase 3.x,InterBase 4.x,InterBase 5.0,InterBase 5.1,InterBase 5.2,InterBase 5.5,InterBase 5.6,InterBase 6.0 Article ID: 23216 Publish Date: September 21, 2000 Last Modified: October 27, 2000 ID ¹°Ç°:23216Àº ³¯Â¥¸¦ ÃâÆÇÇÑ´Ù:2000 ³â 9 ¿ù 21 ÀÏÀº ºÎºÐ ¼öÁ¤µÇ¾î¼­ °è¼ÓµÈ´Ù:2000 ³â 10 ¿ù 27 ÀÏ